Login or Sign Up to become a member!

EXPERTS, INFORMATION, IDEAS & KNOWLEDGE

Social bookmarker Add this

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

From Wiki

Jump to: navigation, search

I am seeing a lot of searches on Lessthandot from Yahoo and 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.


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


Image:sql2005Security_0.jpg


For the SQL server 2000 version go here: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection. SQL 2000


Contributed by: --SQLDenis 15:42, 9 June 2008 (GMT)


Part of SQL Server Admin Hacks

394 Rating: 5.0/5 (1 vote cast)