views:

36

answers:

4

Using SQL Server 2005

I have the server connection name as (server1) in windows authentication mode, I want to change windows authentication mode to sql server authentication mode...

when i try to change sql server authentication mode with username = sa & password = sa, it showing error...

How to change the authentication mode or how to create a new sql connection?

+3  A: 

Please post your connection string or have a look at http://www.connectionstrings.com/

Cade Roux
A: 

Did you configure your server to allow SQL authentication? Check by opening SQL Server Management Studio (SSMS), right click your server, choose properties -> security and look at the radio buttons under "Server authentication".

Also, are you sure the password for the account sa is sa?

scherand
Gopal
scherand
A: 

User name sa its the default name ..........no need to give username ........I think u r mistaken in the password field(password asks two times) u may need to give the password as "a" (password asking two times ,give the same password) It may work

Ram
+1  A: 

Without seeing your connection string, it is difficult to help you, however, judging from what you have said, the problem appears to be in the way you are setting credentials. It should be:

Data Source=<servername>;Initial Catalog=<database name>;User Id=sa;Password=<password>;

Not "username=". Note that I have removed any reference to "Trusted_Connection=yes" or "Integrated Security=SSPI". Btw, did you really need to run your app in the context of sa? If this app really needs to do sysadmin stuff, I would recommend creating a user specifically for that (or an Application Role) so that you can restrict what account can do if necessary.

Thomas
i would suggest to use ip addess instead of server name only because it may conflict if two servers in same network having same windows account. eg two pcs with default windows account admin will conflict with the other one. I faced this issue for two days after which i came to know about the actual reason. I was using VMWare copies on multiple machines.
Shantanu Gupta
@Shantanu Gupta - If you have two machines with the same name on the same network, then there are bigger routing issues to solve. There are reasons to choose IP connections over Named Pipes but name collision shouldn't need to be one of them.
Thomas
@Thomas: I do agree with you up to 100% but this situation is rare and is possible as i overcome it after having a problem. All networking at my workstation is ip driven although at sql server i used name and got the problem. So I also recommend not to use same machine name rather it would be better and safer to use IP
Shantanu Gupta
@Shantanu Gupta - If you to use TCP/IP, then you shouldn't use the actual IP address but instead the DNS name so that it can easily be changed later. You need to include something like Network Library=DBMSSOCN in your connection string to force the connection to use TCP/IP. If you do that, then the data source can be the DNS name.
Thomas