19

When I try to modify a database diagram created before the application restart and crashes when trying to access. It happen only when I save the diagram and close the application. When I try to reopen it throws me an error then restart the SSMS.

I'm running SQL Server 14.0.100 Express Edition.

I reviewed the Microsoft Event Viewer and I get this:

Faulting application name: Ssms.exe, version: 2019.150.18142.0, time stamp: 0x5d3573be Faulting module name: DataDesigners.dll, version: 2019.150.18142.0, time stamp: 0x5d3573f0 Exception code: 0xc0000005 Fault offset: 0x00004be8 Faulting process id: 0x5ec8 Faulting application start time: 0x01d56d761e232f6c Faulting application path: C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe Faulting module path: C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Tools\VDT\DataDesigners.dll Report Id: e797c8be-6448-4547-9f6f-146cd92d8178 Faulting package full name: Faulting package-relative application ID:

Ivan-San
  • 771
  • 1
  • 5
  • 22
  • 1
    I would suggest that if your are using the visual designer to make schema changes you should learn how to do it with t-sql. The designer seems easy but it causes other issues. Among them names for constraints and such that don't make any sense. – Sean Lange Sep 17 '19 at 16:56
  • 2
    Yeah sure I can, but if we have this tool for making our work more easier why not take advantage. I have been working for like 1 year using the visual designer and I haven't get this errors since they updated to a new version. The visual design it reduce my db design time. That's why I'm using it. – Ivan-San Sep 17 '19 at 17:01
  • The main reason I stay away from the visual designer is because the constraints and foreign keys it creates have a useless name which makes database maintenance a lot more painful than it needs to be. As for why you are receiving that error I have no idea. – Sean Lange Sep 17 '19 at 18:22
  • Good point, there's many areas of opportunity with the designer and I agree with you we should be able to learn and perform both types of modeling. (Visual Design or T-SQL). – Ivan-San Sep 17 '19 at 18:25
  • How can visual designer faster than t-sql? Unless you type with 1 finger. – Eric Sep 19 '19 at 23:32
  • The Visual Studio Sql Server Database Project Type can give you a similar toolset. – Sql Surfer Sep 20 '19 at 12:08
  • Try this... Reboot your machine. Start ssms with no active connections. Connect to your target database - do nothing else yet. navigate (do NOT Open) to your diagram. Without opening the diagram right click on it and click refresh. Then try to open your diagram. If it opens without error immediately save it. This might help you in your situation. – Sql Surfer Sep 20 '19 at 12:12
  • It can be permission issue also.Like Permission to open table in design mode is denied.so when we try to open table in design mode SSMS crash.May be "Grant permission not properly executed".not sure why it occur. – KumarHarsh Sep 24 '19 at 03:44
  • 1
    I [posted a workaround](https://stackoverflow.com/questions/57106005/sql-server-management-studio-crashes-after-opening-database-diagram/60105935#60105935) to this. – Adail Retamal Feb 07 '20 at 01:34

2 Answers2

28

On July 22, 2020 MS released SSMS version 18.6 and one of the items in its Bug Fixes list is Database Diagrams:

Fixed long outstanding issue with Database Diagrams, causing both the corruption of existing diagrams and SSMS to crash. If you created or saved a diagram using SSMS 18.0 through 18.5.1, and that diagram includes a Text Annotation, you won't be able to open that diagram in any version of SSMS. With this fix, SSMS 18.6 can open and save a diagram created by SSMS 17.9.1 and prior. SSMS 17.9.1 and previous releases can also open the diagram after being saved by SSMS 18.6. See SQL Server user feedback.

They refer to the UserVoice item that I mentioned below in my original answer. That item got 1239 votes and is now marked as Completed and has a link to blog post by Drew Skwiers-Koballa, Program Manager, SQL Server. The blog post has almost identical text:

The 18.6 release is the second major release of SSMS in 2020 and packs several high impact changes, including a fix for crashes in database diagrams.

If you created or saved a diagram using SSMS 18.0 through 18.5.1, and that diagram includes a Text Annotation, you won’t be able to open that diagram in any version of SSMS. With this fix, SSMS 18.6 can open and save a diagram created by SSMS 17.9.1 and prior as well as by other SSMS 18.6 instances. SSMS 17.9.1 and prior versions will also be able to open the diagram after being saved by SSMS 18.6.

Here is my original answer that I wrote before SSMS 18.6 was released.


MS acknowledged that there is a problem with Database Diagrams feature in the SSMS as of 18.2 (Still 18.5.1). You can use the previous SSMS version 17.9.1, which supports all features of SQL Server 2017 that you use.

In fact, they removed Database Diagrams feature in SSMS 18.0, then returned it back in 18.1 after people asked for it, but it has a problem.

In Release notes for SQL Server Management Studio (SSMS) under Known issues (18.2) there is an item:

Database Diagram created from on an SSMS running on machine A cannot be modified from machine B (it would crash SSMS). See UserVoice for more details.

Vote for a fix on UserVoice: SSMS 18.1 Crashes when Opening a Database Diagram

The MS Product Manager replied there:

I’d like to provide an update on this issue/

Unfortunately, it is proving to be pretty complex to deal with this this ancient technology that is used by SSMS. That’s why it’s being quite challenging for me to find a fix.

I’ll keep working on this, but sadly there is no fix in sight yet.

-Matteo

Vladimir Baranov
  • 31,799
  • 5
  • 53
  • 90
  • 5
    This seems worthy of the bounty – xr280xr Sep 26 '19 at 15:43
  • 1
    Have the same issue on 18.5.1 – motevalizadeh Jun 16 '20 at 20:34
  • 1
    The user `-Matteo` answered on this thread https://feedback.azure.com/forums/908035-sql-server/suggestions/37992649-ssms-18-1-crashes-when-opening-a-database-diagram "I regret to inform that I did not get to fix this for SSMS 18.5, you may have read in the Release Notes. I’ll be on this as soon as I can. I feel bad… I know :(" – Ivan-San Jun 17 '20 at 14:34
  • Can't believe this is still an issue but it's great to know that text diagrams cause the problem. I have moved on to third party solutions for diagrams - which is ridiculous. – Brian MacKay Sep 29 '20 at 19:18
5

Issue has been fixed in 18.6, updated it today and works like a charm, but mind that you have to recreate all the diagrams that you have created in versions 18.0 to 18.5. If you create them again with 18.6 they open without crashing.

Naser Arab
  • 141
  • 1
  • 10