How do I update a database Diagram in Microsoft SQL Server Management Studio
Asked Answered
R

3

10

I currently have the database diagram window open in Microsoft Server Management Studio 2014. Is there a way to "refresh" the view so that I can see a newly added foreign key constraint?

Rollin answered 16/11, 2016 at 17:24 Comment(3)
Close the diagram and open it again?Abet
Sometimes restart SSMSPoock
I was looking for a way to update the layout without having to exit the diagram, or exit the program. Just removing the table and adding it back to the diagram updates the connections.Rollin
R
6

It looks like the best way is to right click on the diagram and choose "remove table from diagram". Then right click in the white space and choose "Add Table". It will then show newly created relationships.

Rollin answered 16/11, 2016 at 17:32 Comment(0)
X
8

Close the diagram. Right click on the diagram name under the "Database Diagrams" node on the tree to the left and select "Refresh", then re-open the diagram. That worked for me when I was trying to get the new fields, updated field names, and updated "nullable" values to display. It also didn't scramble the custom layout I did in the diagram, which I was afraid might happen. If your diagram is missing entire tables, then open the diagram, right click in the diagram's blank space, and select "Add Table" to add missing tables.

This was the first result that came up when I was trying to figure out how to refresh the tables to reflect new fields and such. I was hoping I wouldn't have to delete/re-add each table one-by-one!

Xever answered 6/2, 2019 at 21:0 Comment(0)
R
6

It looks like the best way is to right click on the diagram and choose "remove table from diagram". Then right click in the white space and choose "Add Table". It will then show newly created relationships.

Rollin answered 16/11, 2016 at 17:32 Comment(0)
R
0

In Microsoft SQL Management Studio 19 (and higher, could not test lower version) If you just added the column to your table through and Alter command,

  1. Make sure your diagram is closed.
  2. Then refresh your table (In Object Explorerright, under Tables, right-click your table, select Refresh)
  3. Refresh your diagram (In Object Explorerright, under Database Diagrams, right-click your table, select Refresh)
  4. Open your diagram and the new column(s) should appear

Step 2 is important, otherwise the Object Explorer does not know about the new column, and it won't be able to add it to your diagram.

Rodmun answered 23/12, 2023 at 15:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.