SSMS 19.1.56 can't connect to SQL server on Windows 11

Marie Phillips 0 Reputation points
2023-11-06T22:57:07.4733333+00:00

I have Windows 11 22H2 and SSMS 19.1.56 on my new laptop.

Sometimes (I've only had the new laptop one week) I can connect to SQL server in SSMS and some days (or part of days) I get "The target principal name is incorrect. Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)"

Today I was able to connect successfully (after rebooting laptop twice), see databases, expand databases to view tables and run queries.

About an hour later, when attempting to expand one of the databases to take a look at a stored procedure, I got the following message when attempting to expand the database to access the stored procedure in the Programmability folder :

"Failed to connect to server. The target principal name is incorrect. Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)" And the + sign next to database name disappears.

I then tried to refresh the connection to the server by right clicking the server name in the Server Explorer and select Refresh - and got this message:

"Failed to retrieve data for this request. ...The target principal name is incorrect. Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)"

However, in the query window I can still run querier toward the database that generated the first error message when I tried to expand it.

I can run queries against any of the databases, even all those that threw "failed to connect" errors when attempting to expand to see tables. But I can't expand them to see the tables or stored procedures.

Why does Server Explorer throw errors, when I can target the databases fine using Query window?

I have the identical setup on Windows 10 and SSMS 19.1, targeting the identical server and it works like a charm.

Why is it not working with Windows 11? I tried connecting via IP as well, but that renders SSMS useless. It becomes so slow I can't do anything, not even expanding a database.

I'm unable to transition to my new laptop because I can't get SSMS to work.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,818 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PercyTang-MSFT 12,501 Reputation points Microsoft Vendor
    2023-11-08T01:06:08.63+00:00

    Hi @Marie Phillips

    Security Support Provider Interface (SSPI) is a set of Windows APIs that allows delegation and mutual authentication over any generic data transport layer, such as TCP/IP sockets.

    Based on the error message you posted, you can refer to this troubleshooting document.

    https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/cannot-generate-sspi-context-error?source=recommendations

    Best regards,

    Percy Tang

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.