SQL Server Error Message: Cannot Generate SSPI Context

Cannot generate SSPI context means SQL server failed to authenticate (when using Windows Authentication) with your active directory or your  Active Directory Server is not responsive.

Please talk to your ISP or network administrator trying to get your Active Directory server in a better state as the real fix, but in the interim, you can try to mitigate the problem by reducing the number of logins/logouts to SQL Server. Does your application use Connection Pooling? If not, enabling it to use Connection Pooling might be helpful, since reusing a pooled connection means it does not need to authenticate again

Also, 

How to troubleshoot the “Cannot generate SSPI context” error message

http://support.microsoft.com/default.aspx?scid=kb;en-us;811889

The following blog posts from SQL Protocols team see it helps

http://blogs.msdn.com/b/sql_protocols/archive/2005/10/15/481297.aspx

http://blogs.msdn.com/b/sql_protocols/archive/2007/01/02/cannot-generate-sspi-context-error-message-poisoned-dns.aspx

Download the setspn tool from link above.  Insure your SQL Server service is started.  Next try to delete all the SPNs you see for this instance of SQL using the setspn tool (read KB article 811889 to determine how to do this).  If you cannot delete the SPNs, then the SPNs are assigned to some domain user account and you need a domain administrator to delete it.  Delete all SPNs for the SQL Server instance, then stop and restart SQL.  Next, use the setspn tool to see if the SPN is re-created.  If the SPN is recreated, then everything should work fine at this point.  If the SPN is not created at this point, you will need to contact the domain admin and have him or her create the SPN under the account that the SQL Server service is running under.

Another alternative is to use SQL server authentication, but again talk to your network guys and find out why SQL have problems talking to AD

Advertisements
This entry was posted in SQL Server Data Access. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s