Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create SSPI context

I am working on a .NET application where I am trying to build the database scripts. While building the project, I am getting an error "Cannot create SSPI context.". This error is shown in the output window (inside VS2008 screen) and the building process failed. Please help on this. SQL Server is configured to work on Windows authentication & running as network service (these two things are must for my project).

Please help on this. This error is not seems to be consistent. It was fixed in the past by restarting the machine, changing the system time to match the domain time and some suggestions in the net. Please help on this.

like image 881
Prasanna Avatar asked Nov 28 '09 13:11

Prasanna


People also ask

How do you resolve the target principal name is incorrect Cannot generate SSPI context?

There are a couple of solutions for this problem. You can elevate permissions and use domain admin account for your SQL Server Service (Not recommended). You can manually create an SPN for your computer that is running SQL Server and assigned that SPN to the service account of the SQL Server service on that machine.

What is SSPI in SQL Server?

SSPI stands for Security Support Provider Interface. The SSPI allows an application to use any of the available security packages on a system without changing the interface to use security services.


2 Answers

It sounds like your PC hasn't contacted an authenticating domain controller for a little while. (I used to have this happen on my laptop a few times.)

It can also happen if your password expires.

like image 192
Jeremy McGee Avatar answered Oct 08 '22 05:10

Jeremy McGee


It's quite a common error with a variety of causes: start here with KB 811889

  • What version of SQL Server?
  • And Windows on client and server?
  • Local or network SQL instance?
  • Domain or workgroup? Provider?
  • Changing password
  • Local windows log errors?
  • Any other apps affected?
like image 30
gbn Avatar answered Oct 08 '22 06:10

gbn