Cannot generate SSPI Context

Posted on

Question :

When I try to connect to a SQL Server from my local machine I get the following error:

Cannot connect to Computer1Instance1.
The target principal name is incorrect.
Cannot generate SSPI context.
(Microsoft SQL Server, Error: 0)

When I tried to connect to the same instance through RDP, it throws the following error:

TITLE: Microsoft SQL Server Management Studio
Error connecting to ‘Computer1Instance1’.
Attempted to divide by zero. (mscorlib)

At the same time it is connecting successfully through CMD. It was working fine, until last night. but now I am unable to connect to it.

Answer :

This error occurred because the TCP port was wrongly configured for the instance.

Initially, I checked named pipes and shared memory; everything was perfect. Then I discovered that the TCP/IP protocol port was mismatched, by checking the port configuration in the IP Address tab.

I enabled port 1433 for the server’s IP address and pressed OK. Now it works.

I have had this happen when it loses a trust relationship with the domain. One of my solutions is to open up a command window and type in ipconfig /registerdns, wait 15 minutes and try again.

Leave a Reply

Your email address will not be published. Required fields are marked *