Thursday, January 21, 2010

How to fix SQL Server Error "Cannot Generate SSPI Context"

I have gotten this error multiple times and finally found the fix. I always get it when I have a new server up on the network and try to connect back to it from SSMS on another machine. I can't tell you exactly what causes it, since I don't get it consistently across machines. The quick answer is: Change the account that SQL Server itself runs under to LocalSystem.

*Edit* Removed link to SQL Server Pro that stopped working.

7 comments:

Anonymous said...

can you post the articale as ur link is pointing to the site.

Anonymous said...

I found that the incorrect date and time on a client which differs from a domain controller can also cause "Cannot Generate SSPI Context" failures.

buy viagra said...

Thank you a lot Josh, I have suffered due to this error multiple times as well and as you, I did not know the solution till now.

Anonymous said...

Thanks!
Couldnt figure it out as i was able to connect on ip.

Josh Robinson said...

Regarding comment on May 12, 2010 about broken link. Not sure what happened there, I guess the destination site no longer wanted direct links so I removed it from the post to avoid confusion.

-Josh

Anonymous said...

You should really check the time in both servers, that solve it for me

Claudio said...

That is not really a solution.
The problem is that you don't have a SPN defined.
Create the SQL SPN and you'll solve the problem.

See setspn.exe for more info.