Google
Google Interview Questions | SQL Server Software | Microsoft SQL Server Books | Contact Me | Pro SQL server 2005 (Apress)
Top 10 Articles | Add Yourself To My Frappr Map | Ken Henderson Interview | Louis Davidson Interview

Wednesday, February 01, 2006

Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection. SQL 2005

I am seeing a lot of searches on this blog or reaching this blog from MSN/Google with this search “SQL 2005 Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.” So this is what causes the problem: your SQL Server has been setup with windows authentication only. In order to make it mixed mode authentication right click on the server name in enterprise manager select properties and click on the security tab. Select SQL server and Windows Authentication mode(see picture…) and that will fix it The cool thing about SQL server 2005 is that you can script this out so that you can run the code on multiple servers instead of going to all the servers and clicking etc. Just click on script and code like the one below will be generated

USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO

For the SQL server 2000 version go here

5 Comments:

Anonymous Anonymous said...

thanks

3:38 AM  
Anonymous Anonymous said...

thanks...

11:50 AM  
Anonymous Anonymous said...

I need to restart the SQL Server service for it to work.
Anyway, thanks :)

8:14 PM  
Anonymous moavia hassan said...

thanks it worked for me

1:42 AM  
Anonymous Anonymous said...

thanks
Works perfect

4:13 PM  

Post a Comment

<< Home