Saving work on a DB Diagram failed.

Michael Durthaler 1 Reputation point
2021-12-10T19:42:19.787+00:00

I am creating a detailed ERD with Database Diagrams in SSMS, most recent version. For the most part, aside from having to rearrange original table positions, etc. to coordinate different objects, this tool is a Godsend.

This said, I'm adding classes of tables from a very large database into a diagram. The most commonly referenced table and one or 2 other classes of tables was done. This was saved.

Next a more complex class of tables, referencing each of the classes of tables was added. Seeing that this didn't work out, I closed the diagram without saving changes. Reopening it, I found the PROJECT_USERS table (the most referenced) and just ONE of the 3 other classes of object tables. This was what I had started with some 2 hours ago.

This work is GONE. :) All I wanted to do was exclude changes back to the most recent save, such as with Microsoft Word or more pertinent, an SQL Query. If this were a SPROC, I could have closed and not saved changes, reopened it and found all my prior work right in front of me.

This is not the case with DB Diagrams. The initial table choices when first making the diagram and NOT subsequently added classes of table objects are saved.

Why is this?

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,367 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Durthaler 1 Reputation point
    2021-12-10T19:59:29.06+00:00

    Never mind ...

    I renamed the diagram later in the process. When I reopened what I thought was the right one (my renamed one) it only showed what I initially started with.

    Finding the incompletely named file, and opening it, all my work was saved as desired.

    So ... SSMS will save the rename of the file but post changes to the misnamed one that was started with? It appears so. My steps were:

    1. Create a new diagram.
    2. Add the initial tables
    3. Later on, discover the diagram could be better named, renamed it.
    4. Saved my work up to this point.
    5. Continued work and added a class of tables that discombobulated all my prior work :)
    6. Closed the diagram and reopened the renamed one, which only showed the initial tables
    7. Created the first post
    8. SSMS mysteriously crashed, restarted it
    9. Upon restarting the Diagrams folder was of course refreshed by default. I could now see the incorrectly named file.
    10. Opened the incorrectly named file, discovering to my pleasure all my work WAS saved prior to adding the class of tables that jacked it all up, LOL.

    So until the folder is refreshed ONLY the renamed file shows. It's not necessarily the one holding all the work. The original misnamed file wasn't in the list of choices yet.

    Is this really a problem with SSMS, though? I would think if I rename a file and no others are in the list, that the renamed file IS the one current work is being saved to.

    Thanks!

    0 comments No comments

  2. YufeiShao-msft 7,091 Reputation points
    2021-12-13T03:06:12.763+00:00

    Hi MichaelDurthaler-0453,

    Add the initial tables
    Later on, discover the diagram could be better named, renamed it.

    Renaming is equivalent to the point where you create a brand new diagram, and your subsequent operation is creating another diagram, so another diagram will exist, showing the initial name

    Regarding refreshing, it is normal that when you create a database or a table, sometimes you have to refresh to make your new creation appear. It is just that there is some delay in not showing up in the list, but it is actually there

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments