Creating Database Diagrams in SQL Server Management Studio can make the application lock up
Got a question today from a colleague. He had an application that could create a diagram for a database. This was an old program (last release in 2009) and it worked with Java. If i was able to install the application for an audit. My first thought was: “Why? SSMS is able to do this!”. So started SSMS and logged in to the SQL Instance, opened the database diagrams section and dumped all the tables in the canvas………
And SSMS stopped responding. 15 minutes later everything went down the drain. The application didn’t respond at all. Had to restart the application. Went for a retry and just added 25 tables at a time and again same issue when i added the last set: SSMS stopped responding, after 15 minutes i had to kill the app…. 🙁 Tried a smaller set of 10 at a time, but it all seemed to lock up.
The problem seemed to happen when a lot of tables were added and the app had to create the relationships between the new tables and then create the relationship between the nw tables and the old ones.
Eventually found a solution: When in the screen where you can add the tables, select the first one and press add. That table is added and removed from the screen and the next new top one is selected , press add. Now SSMS only has to create the relations between the newly added table and the ones already on the canvas, so it’s less intensive. When you add al the tables like this and the screen is empty, you can close it and start working imediatly without lag or something.