Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Friday, March 30, 2012

how can i connect to sqlserver express manually when i use text boxed

hi guys,


i am very happy that i found this forum which discuss ASP.net.
i am new to ASP.net 2.0 and some need serious help. when i debug my application and try to insert data an error occur saying:

"Cannot open database "ecb" requested by the login. The login failed. Login failed for user 'HOME-USER\user'."

the code that i have used to submit data is as follow:

Imports System.Data.SqlClient
...
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Dim objConn As SqlConnection
Dim objCmd As SqlCommand

objconn =New SqlConnection("data source= localhost\sqlexpress; initial catalog =ecb; persist security info =true; trusted_connection=true")

objCmd = New SqlCommand("INSERT INTO staff (firstname, surname) VALUES (@.firstname, @.surname,)", objConn)

objCmd.Parameters.Add("@.FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text
objCmd.Parameters.Add("@.Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()

i also used this data connection but didn't help:
objconn = New SqlConnection("Server=localhost; Database=ecb;user ID=' ';Password=' ' ") when i use this data

connection i get this message: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

as far as i can remember i have used windows authentication when creating my database in sql server 200 express edition.

the funny thing is that when i use datagrid wizard or dataform the connection is fine ( i mean is automatically done for me but i don't know when i like to do it manually does not work).

can anyone help? thank you in advanced

Hi!

My guess is going to be that you have selected Mixed Authentication mode when you installed the server. Try specifying login details in your connection string. My guess is going to be 'ASPNET' for username and "" for password.

Something else:

What i could recommend you to do is to have a look at this link:http://www.asp.net/default.aspx?tabindex=4&tabid=3000. See Working with "Gridview and Formview"

If you are only updating Firstname and Surnames fields and other basic tasks, then you might rather want to make use of the visual tools in VWD to accomplish this.

|||

hi again:

thank you for your help. Anyway it sounds like is not working. i have tried many many solutions but all failed. however my question here can i uninstall SQL server express edition while keeping hold of the tables that i have done (is quite important)? and then reinstall the application just to make sure that the authentication level i will use is correct ( because i can't remember whether i have used sql server authentication or windows based authentication.!!!

do you thing is a good solution? if yes would you please tell me how to keep the tables and uninstall the application?

Many thanks saif44

|||

If you have created the website in your file system then its all fine. If you really want to then just make a back up of the folder.

You can go ahead and do a re-installation.

It really hard to say if its a good solution. I cant say. It's def worth a tryWink [;)]

|||

Hello Saif,

This might help, I was having the same issue and this is one way to figure out your connection string.

Use your datagrid wizard and create a valid connection and make sure it works, then go back to your datagrid and go to configure data source.

This takes you to choose your data connection menu and the current connection that your datagid is using will be selected in the drop down list. Below the drop down list is a box with a + and the words connection string across from it. Click the + button and the connection string that was generated by the wizard will be shown. That should be your valid connection string that works.

A nicer way of doing it is to create the connection string in the web.config file and then reference the connection string name in your code.

for example in my web.config file I have this connection string:

<connectionStrings>

<removename="LocalSqlServer"/>

<addname="LocalSqlServer"connectionString="Server=[your server name];Database=[ur dbase name];User ID=;Password=;Trusted_Connection=False"/>

</connectionString>

Now I can reference the connection string programatical in my code as such:

Using connectionAsNew SqlConnection(ConfigurationManager.ConnectionStrings"LocalSqlServer").ConnectionString)

....[my code here]

end using

Of course this is just a short explanation, hopefully it gets you in the right direction.

The best resource I have found for asp.net is from 4guysfromRolla.com, this is their article on connection to a database:

http://aspnet.4guysfromrolla.com/articles/022206-1.aspx

thanks,

manny

|||Thank you very very much Manny. the problem is sloved. However, there is another problem with

objCmd.ExecuteNonQuery() it triggers a message saying "Invalid object name 'staff ' ". i don't know why this is happening?' Staff ' is the name of my table i am using and its syntax is correct.

please can you review this code for me and tell me what's wrong with it:

............

objconn =New SqlConnection(ConfigurationManager.ConnectionStrings("localsqlserver").ConnectionString)

objCmd =New SqlCommand("INSERT INTO staff(staffno, FirstName, Surname, DateRegistered) _

values (@.staffno, @.firstname, @.surname, @.dateregistered)", objconn

objCmd.Parameters.Add("@.StaffNo", Data.SqlDbType.Int).Value = txtStaffNo.Text

objCmd.Parameters.Add("@.FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text

objCmd.Parameters.Add("@.Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objCmd.Parameters.Add("@.DateRegistered", Data.SqlDbType.SmallDateTime).Value = txtRegDate.Text

objConn.Open()

objCmd.ExecuteNonQuery()

objConn.Close()

Response.Redirect("addstaff.aspx")

I have to say here that i am using an automatic insertion of the StaffNo when i first created the data definition table. do you think the code above is correct for the StaffNo? and what do you think it does cause the above error message to be trigged.

thank you very much for your help

Monday, March 26, 2012

How Can I Change the data type of the parameter for the Deployed Stored Procedure ?

Hi

I have Try to Create Stored Procedure in C# with the following structure

[Microsoft.SqlServer.Server.SqlProcedure]

public static void sp_AddImage(Guid ImageID, string ImageFileName, byte[] Image)

{

}

But when I try to deploy that SP to SQL Server Express , The SP Parameters become in the following Stature

@.ImageID uniqueidentifier

@.ImageFileName nvarchar(4000)

@.Image varbinary(8000)

But I don’t want that Data types .. I want it to be in the following format

@.ImageID uniqueidentifier

@.ImageFileName nText

@.Image Image

How Can I Control the data type for each parameter ?

Or

How Can I Change the data type of the parameter for the Deployed Stored Procedure ?

Or

How Can I defined the new Data type ?

Or

What's the solution to this problem ?

Note : I get Error when I try to use Alert Statement to change the parameter Data type for the SP

ALTER PROCEDURE [dbo].[sp_AddImage]

@.ImageID [uniqueidentifier],

@.ImageFileName nText,

@.Image Image

WITH EXECUTE AS CALLER

AS

EXTERNAL NAME [DatabaseAndImages].[StoredProcedures].[sp_AddImage]

GO

And thanks with my best regarding

Fraas

Hi Fraas

You may change parameter types (from nvarchar(4000) to nvarchar(max), for example), but you can't pass values bigger than 8000 bytes directly...

If you need nText or Image handling inside your .NET sp's, you should use .NET wrappers for this SQL types. Consider following procedure definition:

public static void AddImage(Guid ImageID, SqlChars FileName, SqlBytes image)

{

SqlContext.Pipe.Send(String.Format("Image: id {0}, filename length: {1}, image size: {2}", ImageID.ToString(), FileName.Value.Length, image.Length));

}

After deploying this proc, parameter types are uniqueidentifier, nvarchar(max) and varbinary(max).
nvarchar(max) should be used instead of ntext, and varbinary(max) instead of image types accordingly. Ntext and image are deprecated.

simple test (values bigger than 8000 can pass! ;-)):

declare @.id uniqueidentifier, @.image varbinary(max), @.filename nvarchar(max)

select @.filename = (select * from AdventureWorks.Person.Contact for xml auto, elements)

--or select @.filename = (select convert(nvarchar(max), replicate(N'1', 8000)) + convert(nvarchar(max), replicate(N'2', 8000)) )

select @.image = convert(varbinary(max), @.filename)

select @.id = newid()

exec AddImage @.id, @.filename, @.image

WBR, Evergray

--

Words mean nothing...

P.S. Do you really need ntext for storing file name?

|||What you are seeing is Visual Studio's mapping of CLR types to SQL

types, where string/SqlString maps to nvarchar(4000) and byte[] maps to

varbinary(8000).

The ntext and image datatypes in SQL 2005 are now deprecated and you

should use nvarchar(max) and varbinary(max) instead. To automatically

get those types from your CLR code, you should use the SqlChars and SqlBinary types from the SqlTypes namespace instead.

Niels|||

Hi

Thanks for the replies

Surly I will not save the File Name in (nText) Data Type but this is only as example .. I need to use the nText Type to store large text Date in the filed

And I need the Image Data Type to store Large File In the Database

|||Let's just make sure we're all on the same page here. From your response above I'm not usre if you realize (if you do I apologize) that ntext/text and image in SQL 2005 are being deprecated and eventually will go away (they are there now only for backward compatibility). They are being replaced with the nvarchar(max)/varchar(max) and varbinary(max) datatypes. These new datatypes have the same storage capabilities as the old ntext and image, but are much easier to work with

So in SQL 2005 you would use the nvarchar(max) type to store larger text date and varbinary(max) to store a large file. Subsequently, when you use VS to create SQCLR assemblies and stored procs you can use the SqlChars and SqlBinary datatypes in order to get automatic mapping to ntext(max) and varbinary(max) during deployment.

Niels|||

Thanks for all replies .. as I can see it solve my problem when the nVarchar(Max) replace for nText

With my regarding

Fraas

How Can I Change the data type of the parameter for the Deployed Stored Procedure ?

Hi

I have Try to Create Stored Procedure in C# with the following structure

[Microsoft.SqlServer.Server.SqlProcedure]

public static void sp_AddImage(Guid ImageID, string ImageFileName, byte[] Image)

{

}

But when I try to deploy that SP to SQL Server Express , The SP Parameters become in the following Stature

@.ImageID uniqueidentifier

@.ImageFileName nvarchar(4000)

@.Image varbinary(8000)

But I don’t want that Data types .. I want it to be in the following format

@.ImageID uniqueidentifier

@.ImageFileName nText

@.Image Image

How Can I Control the data type for each parameter ?

Or

How Can I Change the data type of the parameter for the Deployed Stored Procedure ?

Or

How Can I defined the new Data type ?

Or

What's the solution to this problem ?

Note : I get Error when I try to use Alert Statement to change the parameter Data type for the SP

ALTER PROCEDURE [dbo].[sp_AddImage]

@.ImageID [uniqueidentifier],

@.ImageFileName nText,

@.Image Image

WITH EXECUTE AS CALLER

AS

EXTERNAL NAME [DatabaseAndImages].[StoredProcedures].[sp_AddImage]

GO

And thanks with my best regarding

Fraas

Hi Fraas

You may change parameter types (from nvarchar(4000) to nvarchar(max), for example), but you can't pass values bigger than 8000 bytes directly...

If you need nText or Image handling inside your .NET sp's, you should use .NET wrappers for this SQL types. Consider following procedure definition:

public static void AddImage(Guid ImageID, SqlChars FileName, SqlBytes image)

{

SqlContext.Pipe.Send(String.Format("Image: id {0}, filename length: {1}, image size: {2}", ImageID.ToString(), FileName.Value.Length, image.Length));

}

After deploying this proc, parameter types are uniqueidentifier, nvarchar(max) and varbinary(max).
nvarchar(max) should be used instead of ntext, and varbinary(max) instead of image types accordingly. Ntext and image are deprecated.

simple test (values bigger than 8000 can pass! ;-)):

declare @.id uniqueidentifier, @.image varbinary(max), @.filename nvarchar(max)

select @.filename = (select * from AdventureWorks.Person.Contact for xml auto, elements)

--or select @.filename = (select convert(nvarchar(max), replicate(N'1', 8000)) + convert(nvarchar(max), replicate(N'2', 8000)) )

select @.image = convert(varbinary(max), @.filename)

select @.id = newid()

exec AddImage @.id, @.filename, @.image

WBR, Evergray

--

Words mean nothing...

P.S. Do you really need ntext for storing file name?

|||What you are seeing is Visual Studio's mapping of CLR types to SQL

types, where string/SqlString maps to nvarchar(4000) and byte[] maps to

varbinary(8000).

The ntext and image datatypes in SQL 2005 are now deprecated and you

should use nvarchar(max) and varbinary(max) instead. To automatically

get those types from your CLR code, you should use the SqlChars and SqlBinary types from the SqlTypes namespace instead.

Niels|||

Hi

Thanks for the replies

Surly I will not save the File Name in (nText) Data Type but this is only as example .. I need to use the nText Type to store large text Date in the filed

And I need the Image Data Type to store Large File In the Database

|||Let's just make sure we're all on the same page here. From your response above I'm not usre if you realize (if you do I apologize) that ntext/text and image in SQL 2005 are being deprecated and eventually will go away (they are there now only for backward compatibility). They are being replaced with the nvarchar(max)/varchar(max) and varbinary(max) datatypes. These new datatypes have the same storage capabilities as the old ntext and image, but are much easier to work with

So in SQL 2005 you would use the nvarchar(max) type to store larger text date and varbinary(max) to store a large file. Subsequently, when you use VS to create SQCLR assemblies and stored procs you can use the SqlChars and SqlBinary datatypes in order to get automatic mapping to ntext(max) and varbinary(max) during deployment.

Niels|||

Thanks for all replies .. as I can see it solve my problem when the nVarchar(Max) replace for nText

With my regarding

Fraas

Wednesday, March 21, 2012

How can i attach a SQLServer2005 db to an instance of SQLServer 2000?

i have a db that created in sql2000 and then iattached it to sqlserver 2005 ,now i want to attach this db to sql server 2000 again,but when i do that i get an error message and the attach process fails.plz help me and show me a way to attach this db.

Short answer: you can't :-(
Once you have attached it to SQL Server 2005 it is no longer compatible with the SQL Server 2000 file format.

Monday, March 19, 2012

how can attack database from sqlserver management studio express?

I have created a database named s_office,now i want add file data.MDF and log.LDF into it. .How can i do it?Could you show me the script that attack file .MDF and .LDF into database.thankxhttp://msdn2.microsoft.com/en-us/library/ms179877.aspx

Friday, March 9, 2012

How are LOB columns handeled in sqlserver

Hi ,
I am new to sqlserver family.
when doing the database design , i have the following question.
let's say we have emp table which have empid,empname,deptno,
as well as empPicture, empGreeting, empFamilyPict.
Should we store all the lob columns(empPicture, empGreeting, empFamilyPict)
in a seperate table . what is the best practice for sqlserver 2000 & 2005.
The oracle DB takes care of LOB if it is > 4000 bytes
(ie)when you use clobs, they are moved out of the table into their own
segment when they exceed 4000 bytes, the work is done for you, no need to
factor them out
special.
similarly for Bfiles which is always external.
How does Sqlserver 2000 & 2005 handle this . Both handle LOB's in similar
fashion?
thanks in adv
ThirumaranHi
http://www.aspfaq.com/show.asp?id=2149
"thirumaran" <thirumaran@.discussions.microsoft.com> wrote in message
news:530AF331-165C-411D-915D-22D37A78EDC0@.microsoft.com...
> Hi ,
> I am new to sqlserver family.
> when doing the database design , i have the following question.
> let's say we have emp table which have empid,empname,deptno,
> as well as empPicture, empGreeting, empFamilyPict.
> Should we store all the lob columns(empPicture, empGreeting,
> empFamilyPict)
> in a seperate table . what is the best practice for sqlserver 2000 & 2005.
> The oracle DB takes care of LOB if it is > 4000 bytes
> (ie)when you use clobs, they are moved out of the table into their own
> segment when they exceed 4000 bytes, the work is done for you, no need to
> factor them out
> special.
> similarly for Bfiles which is always external.
> How does Sqlserver 2000 & 2005 handle this . Both handle LOB's in similar
> fashion?
> thanks in adv
> Thirumaran
>
>
>
>|||In addition to Uri's answer you may want to check out LOB in BooksOnLine
2005. This part answers part of you question for 2005.
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/813586f1-edfe-471e-9338-e55e689a1aaa.htm
Andrew J. Kelly SQL MVP
"thirumaran" <thirumaran@.discussions.microsoft.com> wrote in message
news:530AF331-165C-411D-915D-22D37A78EDC0@.microsoft.com...
> Hi ,
> I am new to sqlserver family.
> when doing the database design , i have the following question.
> let's say we have emp table which have empid,empname,deptno,
> as well as empPicture, empGreeting, empFamilyPict.
> Should we store all the lob columns(empPicture, empGreeting,
> empFamilyPict)
> in a seperate table . what is the best practice for sqlserver 2000 & 2005.
> The oracle DB takes care of LOB if it is > 4000 bytes
> (ie)when you use clobs, they are moved out of the table into their own
> segment when they exceed 4000 bytes, the work is done for you, no need to
> factor them out
> special.
> similarly for Bfiles which is always external.
> How does Sqlserver 2000 & 2005 handle this . Both handle LOB's in similar
> fashion?
> thanks in adv
> Thirumaran
>
>
>
>

How are LOB columns handeled in sqlserver

Hi ,
I am new to sqlserver family.
when doing the database design , i have the following question.
let's say we have emp table which have empid,empname,deptno,
as well as empPicture, empGreeting, empFamilyPict.
Should we store all the lob columns(empPicture, empGreeting, empFamilyPict)
in a seperate table . what is the best practice for sqlserver 2000 & 2005.
The oracle DB takes care of LOB if it is > 4000 bytes
(ie)when you use clobs, they are moved out of the table into their own
segment when they exceed 4000 bytes, the work is done for you, no need to
factor them out
special.
similarly for Bfiles which is always external.
How does Sqlserver 2000 & 2005 handle this . Both handle LOB's in similar
fashion?
thanks in adv
ThirumaranHi
http://www.aspfaq.com/show.asp?id=2149
"thirumaran" <thirumaran@.discussions.microsoft.com> wrote in message
news:530AF331-165C-411D-915D-22D37A78EDC0@.microsoft.com...
> Hi ,
> I am new to sqlserver family.
> when doing the database design , i have the following question.
> let's say we have emp table which have empid,empname,deptno,
> as well as empPicture, empGreeting, empFamilyPict.
> Should we store all the lob columns(empPicture, empGreeting,
> empFamilyPict)
> in a seperate table . what is the best practice for sqlserver 2000 & 2005.
> The oracle DB takes care of LOB if it is > 4000 bytes
> (ie)when you use clobs, they are moved out of the table into their own
> segment when they exceed 4000 bytes, the work is done for you, no need to
> factor them out
> special.
> similarly for Bfiles which is always external.
> How does Sqlserver 2000 & 2005 handle this . Both handle LOB's in similar
> fashion?
> thanks in adv
> Thirumaran
>
>
>
>|||In addition to Uri's answer you may want to check out LOB in BooksOnLine
2005. This part answers part of you question for 2005.
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/813586f1-edfe-471e-9338-e55e
689a1aaa.htm
Andrew J. Kelly SQL MVP
"thirumaran" <thirumaran@.discussions.microsoft.com> wrote in message
news:530AF331-165C-411D-915D-22D37A78EDC0@.microsoft.com...
> Hi ,
> I am new to sqlserver family.
> when doing the database design , i have the following question.
> let's say we have emp table which have empid,empname,deptno,
> as well as empPicture, empGreeting, empFamilyPict.
> Should we store all the lob columns(empPicture, empGreeting,
> empFamilyPict)
> in a seperate table . what is the best practice for sqlserver 2000 & 2005.
> The oracle DB takes care of LOB if it is > 4000 bytes
> (ie)when you use clobs, they are moved out of the table into their own
> segment when they exceed 4000 bytes, the work is done for you, no need to
> factor them out
> special.
> similarly for Bfiles which is always external.
> How does Sqlserver 2000 & 2005 handle this . Both handle LOB's in similar
> fashion?
> thanks in adv
> Thirumaran
>
>
>
>

How access SqlServer from the Web

Hello:
I apologize my question involves some Web contents, but I don`t know where
expose it.
I have a local Sql Server database running under W2000 server. This machine
have permanent Internet access . Can I connect a Visual Basic program running
in a remote PC machine to the Sql Server Database, directly through the Web ?
I would appreciate any suggestion or reference to technical article.
My best regards.
Roberto
Yes, you can do that.
My recommendation is to use a VPN to the SQL Server rather than directly (if
possible) and lock down the IP address of the client machine on the server
firewall.
Alternatively you can open up the port that SQL Server listens on (incoming)
to the SQL Server machine and open all (outgoing) from the SQL Server
machine. I'd set SQL Server to use a different port other than the default
1433, say 2025 or something (on the server use the Netowkr Configuration
Utility in the SQL program group) - you can get the client to use that port
using the client config utility on the client.
Hope that helps.
Last but not least, get it on SQL Sp4.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Roberto Carabajal" <RobertoCarabajal@.discussions.microsoft.com> wrote in
message news:849989E8-B257-4E25-9A2F-2E86CA164C67@.microsoft.com...
> Hello:
> I apologize my question involves some Web contents, but I don`t know
> where
> expose it.
> I have a local Sql Server database running under W2000 server. This
> machine
> have permanent Internet access . Can I connect a Visual Basic program
> running
> in a remote PC machine to the Sql Server Database, directly through the
> Web ?
> I would appreciate any suggestion or reference to technical article.
> My best regards.
> Roberto
|||Tony:
Thanks very much.
Roberto

Wednesday, March 7, 2012

How access SqlServer from the Web

Hello:
I apologize my question involves some Web contents, but I don`t know where
expose it.
I have a local Sql Server database running under W2000 server. This machine
have permanent Internet access . Can I connect a Visual Basic program runnin
g
in a remote PC machine to the Sql Server Database, directly through the Web
?
I would appreciate any suggestion or reference to technical article.
My best regards.
RobertoYes, you can do that.
My recommendation is to use a VPN to the SQL Server rather than directly (if
possible) and lock down the IP address of the client machine on the server
firewall.
Alternatively you can open up the port that SQL Server listens on (incoming)
to the SQL Server machine and open all (outgoing) from the SQL Server
machine. I'd set SQL Server to use a different port other than the default
1433, say 2025 or something (on the server use the Netowkr Configuration
Utility in the SQL program group) - you can get the client to use that port
using the client config utility on the client.
Hope that helps.
Last but not least, get it on SQL Sp4.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Roberto Carabajal" <RobertoCarabajal@.discussions.microsoft.com> wrote in
message news:849989E8-B257-4E25-9A2F-2E86CA164C67@.microsoft.com...
> Hello:
> I apologize my question involves some Web contents, but I don`t know
> where
> expose it.
> I have a local Sql Server database running under W2000 server. This
> machine
> have permanent Internet access . Can I connect a Visual Basic program
> running
> in a remote PC machine to the Sql Server Database, directly through the
> Web ?
> I would appreciate any suggestion or reference to technical article.
> My best regards.
> Roberto|||Tony:
Thanks very much.
Roberto

How access SqlServer from the Web

Hello:
I apologize my question involves some Web contents, but I don`t know where
expose it.
I have a local Sql Server database running under W2000 server. This machine
have permanent Internet access . Can I connect a Visual Basic program running
in a remote PC machine to the Sql Server Database, directly through the Web ?
I would appreciate any suggestion or reference to technical article.
My best regards.
RobertoYes, you can do that.
My recommendation is to use a VPN to the SQL Server rather than directly (if
possible) and lock down the IP address of the client machine on the server
firewall.
Alternatively you can open up the port that SQL Server listens on (incoming)
to the SQL Server machine and open all (outgoing) from the SQL Server
machine. I'd set SQL Server to use a different port other than the default
1433, say 2025 or something (on the server use the Netowkr Configuration
Utility in the SQL program group) - you can get the client to use that port
using the client config utility on the client.
Hope that helps.
Last but not least, get it on SQL Sp4.
--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Roberto Carabajal" <RobertoCarabajal@.discussions.microsoft.com> wrote in
message news:849989E8-B257-4E25-9A2F-2E86CA164C67@.microsoft.com...
> Hello:
> I apologize my question involves some Web contents, but I don`t know
> where
> expose it.
> I have a local Sql Server database running under W2000 server. This
> machine
> have permanent Internet access . Can I connect a Visual Basic program
> running
> in a remote PC machine to the Sql Server Database, directly through the
> Web ?
> I would appreciate any suggestion or reference to technical article.
> My best regards.
> Roberto|||Tony:
Thanks very much.
Roberto

hour separator from . to : ?!?!

In my SQLserver DATA datatype appear to me with hour separator "."
(12.00.00)
I want that they appear with separator ":" (12:00:00) (for to prevent ODBC
problems)
(I have changed the international setting of the server... the OS time is
changed, but in the DB I always have the ".")
Any suggestions?
Is this a dattime datatype? If so it is not stored with any type of
delimiter. Internally it is stored as two Integers and it is up to the
front end to display it however they wish. So if it's displaying with a .
you need to look at your GUI or the driver being used. You can also convert
the datetime to a string with CONVERT() to display it in many different
formats. But as a pure datetime it does not have a display format. See
CONVERT() in BOL for more details.
Andrew J. Kelly SQL MVP
"YURYSSG" <yuryssg@.yahoo.it> wrote in message
news:2qlj83F10pofdU1@.uni-berlin.de...
> In my SQLserver DATA datatype appear to me with hour separator "."
> (12.00.00)
> I want that they appear with separator ":" (12:00:00) (for to prevent
ODBC
> problems)
> (I have changed the international setting of the server... the OS time is
> changed, but in the DB I always have the ".")
> Any suggestions?
> --
>
>
|||If you are using the SQL Server ODBC driver, and you are using the driver to
convert from DATETIME to string (ie. binding the column as SQL_C_CHAR), then
you should be able to change the seperator characters using the Regional
settings on the client machine.
Brannon
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:#B$JQaZmEHA.2020@.TK2MSFTNGP09.phx.gbl...
> Is this a dattime datatype? If so it is not stored with any type of
> delimiter. Internally it is stored as two Integers and it is up to the
> front end to display it however they wish. So if it's displaying with a .
> you need to look at your GUI or the driver being used. You can also
convert[vbcol=seagreen]
> the datetime to a string with CONVERT() to display it in many different
> formats. But as a pure datetime it does not have a display format. See
> CONVERT() in BOL for more details.
> --
> Andrew J. Kelly SQL MVP
>
> "YURYSSG" <yuryssg@.yahoo.it> wrote in message
> news:2qlj83F10pofdU1@.uni-berlin.de...
> ODBC
is
>
|||In the worst case if the above do not work you can always use Replace after
you converted it to string and return it as a string.
"Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
news:OphvrcfmEHA.512@.TK2MSFTNGP10.phx.gbl...
> If you are using the SQL Server ODBC driver, and you are using the driver
> to
> convert from DATETIME to string (ie. binding the column as SQL_C_CHAR),
> then
> you should be able to change the seperator characters using the Regional
> settings on the client machine.
> Brannon
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:#B$JQaZmEHA.2020@.TK2MSFTNGP09.phx.gbl...
> convert
> is
>

Monday, February 27, 2012

Hotfix on sp2

Hello,

Just want to know if anybody else has problems with the hotfix ?

I have a sqlserver 2005 on my desktop.

I installed the sp2 before 5th march.

Recently Microsoft changed the sp2 and released a hotfix for sp2 installed(downloaded) before 5th march.

I installed the hotfix but it failed to update the sqlserver engine.

Very weird.

I uninstalled sqlserver 2005, applied the new sp2 (which was smaller compared with previous one)

Today i still received a critical update in windows update.

I installed it, but i still don't trust these updates.

How can i investigate all went well ?

Go to Add/Remove Programs, click on the SQL 2005 entry, click Remove, and then Change. This will show a nice report at the component level and include the versions for each. If they are all at 3152, then your machine is up to date with the cumulative hotfix. If not, go grab it here:

http://support.microsoft.com/kb/933097

Thanks,
Sam Lester (MSFT)

Hotfix on sp2

Hello,

Just want to know if anybody else has problems with the hotfix ?

I have a sqlserver 2005 on my desktop.

I installed the sp2 before 5th march.

Recently Microsoft changed the sp2 and released a hotfix for sp2 installed(downloaded) before 5th march.

I installed the hotfix but it failed to update the sqlserver engine.

Very weird.

I uninstalled sqlserver 2005, applied the new sp2 (which was smaller compared with previous one)

Today i still received a critical update in windows update.

I installed it, but i still don't trust these updates.

How can i investigate all went well ?

Go to Add/Remove Programs, click on the SQL 2005 entry, click Remove, and then Change. This will show a nice report at the component level and include the versions for each. If they are all at 3152, then your machine is up to date with the cumulative hotfix. If not, go grab it here:

http://support.microsoft.com/kb/933097

Thanks,
Sam Lester (MSFT)

Sunday, February 19, 2012

Hosting website on SQL Sever.

I am planning to develop a website which will use SQL
Server as it's database.
My question are:
(1) Do I need to BUY Server in this scenario because I
have to test my website on my local webserver. Ultimately
the site would be uploaded to third-party's hosting
server. Should I buy Developer Edition or Evaluation
Edition or MSDE would work.
(2) I would be required to update my SQL Server database
at least once in a week. How would I copy my database to
hosting server database. If it were Access, I would have
just copy the access database file to the hosting server.
What steps are required to be taken to copy SQL Server
Database sitting in our SQL Server to hosting server?
(3) What are the recommened hosting server websites which
support SQL Server.
(4) Let's say I plan to buy SQL Server and host the
website on our webserver,then which Edition of SQL Server
should I buy ... and how would the licening thing work in
this situation? For how may users/licences I have to buy
this SQL Server?
*1.)
MSDE would work but you won't have enterprise tools.
however if you are developing in .NET then there are some DB tools there.
There is also a freebie IDE for MSDE.
Hosting sites such as www.discountasp.net offer SQL Server for like $25 per
month--1 database
as far as for testing as a developer, I am sure that you have the right to
use it to develop...for sure if you an MSDN subscriber and maybe just as
vb.net pro owner--not sure.
2.) On discountasp.net I can just connect to my database in enterprise
tools...other hosts are probably the same.
if you are using dialup internet connection, then be aware that you will
probably need to modify the database in Query Analyzer using DDL and SQL
statements as using EM tools is too slow...this isn't too bad though.
3.) I have been real happy with discountasp.net... there are others.
4.) Will be expensive if just for hosting on the internet... If you are to
use it in house and on internet...maybe worth it--else you might want to
just host it for $25per month. Average SQL Server, last time I checked
(it's been a while) was $5000 for the server and a decent number of CALS.
And then I know years ago you had to purchase an internet connection license
and it used to be about $1500 per processor for you server. So you can see
it gets expensive...
for more prices I suggest you visit Microsoft's website and read.
HTH,
Shane
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *|||Regarding buying SQL if your internet guy is hosting it... The answer is
NO... The internet company would have purchased SQL Server that you are
using on the hosted web site...
You would be responsible for your test server, and MSDE is appropriate and
intended just for that purpose...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *

Hosting website on SQL Sever.

I am planning to develop a website which will use SQL
Server as it's database.
My question are:
(1) Do I need to BUY Server in this scenario because I
have to test my website on my local webserver. Ultimately
the site would be uploaded to third-party's hosting
server. Should I buy Developer Edition or Evaluation
Edition or MSDE would work.
(2) I would be required to update my SQL Server database
at least once in a week. How would I copy my database to
hosting server database. If it were Access, I would have
just copy the access database file to the hosting server.
What steps are required to be taken to copy SQL Server
Database sitting in our SQL Server to hosting server?
(3) What are the recommened hosting server websites which
support SQL Server.
(4) Let's say I plan to buy SQL Server and host the
website on our webserver,then which Edition of SQL Server
should I buy ... and how would the licening thing work in
this situation? For how may users/licences I have to buy
this SQL Server?
*
1.)
MSDE would work but you won't have enterprise tools.
however if you are developing in .NET then there are some DB tools there.
There is also a freebie IDE for MSDE.
Hosting sites such as www.discountasp.net offer SQL Server for like $25 per
month--1 database
as far as for testing as a developer, I am sure that you have the right to
use it to develop...for sure if you an MSDN subscriber and maybe just as
vb.net pro owner--not sure.
2.) On discountasp.net I can just connect to my database in enterprise
tools...other hosts are probably the same.
if you are using dialup internet connection, then be aware that you will
probably need to modify the database in Query Analyzer using DDL and SQL
statements as using EM tools is too slow...this isn't too bad though.
3.) I have been real happy with discountasp.net... there are others.
4.) Will be expensive if just for hosting on the internet... If you are to
use it in house and on internet...maybe worth it--else you might want to
just host it for $25per month. Average SQL Server, last time I checked
(it's been a while) was $5000 for the server and a decent number of CALS.
And then I know years ago you had to purchase an internet connection license
and it used to be about $1500 per processor for you server. So you can see
it gets expensive...
for more prices I suggest you visit Microsoft's website and read.
HTH,
Shane
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *
|||Regarding buying SQL if your internet guy is hosting it... The answer is
NO... The internet company would have purchased SQL Server that you are
using on the hosted web site...
You would be responsible for your test server, and MSDE is appropriate and
intended just for that purpose...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:0e0d01c47b47$f171fb90$a301280a@.phx.gbl...
> I am planning to develop a website which will use SQL
> Server as it's database.
> My question are:
> (1) Do I need to BUY Server in this scenario because I
> have to test my website on my local webserver. Ultimately
> the site would be uploaded to third-party's hosting
> server. Should I buy Developer Edition or Evaluation
> Edition or MSDE would work.
> (2) I would be required to update my SQL Server database
> at least once in a week. How would I copy my database to
> hosting server database. If it were Access, I would have
> just copy the access database file to the hosting server.
> What steps are required to be taken to copy SQL Server
> Database sitting in our SQL Server to hosting server?
> (3) What are the recommened hosting server websites which
> support SQL Server.
> (4) Let's say I plan to buy SQL Server and host the
> website on our webserver,then which Edition of SQL Server
> should I buy ... and how would the licening thing work in
> this situation? For how may users/licences I have to buy
> this SQL Server?
> *