Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Management Studio crashes after opening database diagram

I have 2 existing database diagram in local server in SQL Server 2018, SSMS 18.1 While opening it, the application becomes "Not Responding" then crashes without any error. It was working fine for the last 7 days.

like image 569
Satish Patro Avatar asked Jul 19 '19 05:07

Satish Patro


2 Answers

I have been dealing with the same issue on SSMS 18.5.

I do not know what causes the [dbo].[sysdiagrams] table to become corrupted but I have found that if I copy the diagrams from an older (working) version of the database, they are editable again.

The TSQL I used to solve the problem:

DELETE FROM [corrupt_database].[dbo].[sysdiagrams];

INSERT INTO [corrupt_database].[dbo].[sysdiagrams]
SELECT [name],
       [principal_id],
       [version],
       [definition]
FROM [valid_database].[dbo].[sysdiagrams];

From my initial testing, the diagrams will save and reopen again; even after restarting SSMS.

like image 122
Neverlyn Avatar answered Sep 22 '22 07:09

Neverlyn


By mean 18, if you have SSMS version 18.0 installed then Database Diagrams were deprecated and removed from 18.0 version, and added back into SSMS version 18.1.

Source: Deprecated and removed features in 18.0:

check out Deprecated and removed features in 18.0 in above Release notes for SQL Server Management Studio (SSMS).

like image 21
Mehran Khan Avatar answered Sep 21 '22 07:09

Mehran Khan