This article helps you resolve the problem where the Object Explorer intermittently hangs when you use SQL Server Management Studio (SSMS) 2012 or a later version.
Original product version: Microsoft SQL Server Management Studio
Original KB number: 4091777
Symptoms
Object Explorer intermittently hangs when you use SSMS. This issue applies to all versions starting from SSMS 2012.
This issue may occur anytime that Object Explorer is in focus (for example, when you click an item in the tree). However, this issue occurs only if all the following conditions are true:
-
SQL Server authentication is used.
-
The default database for the logon that is used to connect is not the master.
-
The SSMS version is 2012 or a later version.
-
Object Explorer is connected to the database engine.
[!NOTE] Query windows do not experience this issue.
Cause
This issue is caused by a type of race condition that occurs between threads that are used by Object Explorer.
Resolution
To prevent this issue from occurring, use any of the following methods:
- Method 1: Use Windows Authentication.
- Method 2: Change the default database setting to the master database for the login.
- Method 3: Change the SSMS connection string to request a connection to the master database.
For Method 2
To change the default database for the login, run the following commands by using a login that has the ALTER ANY LOGIN permission:
USE [master]
GO
ALTER LOGIN [YourLogin] WITH DEFAULT_DATABASE=[master]
GO
For Method 3
To change the SSMS connection string, follow these steps:
-
In Object Explorer, click Connect, and then click Database Engine.
:::image type="content" source="media/object-explorer-intermittently-crashes/database-engine.png" alt-text="Screenshot of the Connect menu of Object Explorer.":::
-
In the Connect to Server window, click the Options button.
:::image type="content" source="media/object-explorer-intermittently-crashes/connect-to-server.png" alt-text="Screenshot of the Connect to Server window.":::
-
On the Connection Properties tab, enter master in the Connect to database field, and then click Connect.
:::image type="content" source="media/object-explorer-intermittently-crashes/connection-properties.png" alt-text="Screenshot of the Connection Properties tab of the Connect to Server window.":::
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
