107

I want to generate an ER diagram of an SQL database using Microsoft SQL Server Management Studio (SMSS). However, I don’t know how to.

I found this technique online: Making ER Diagram from SQL Server 2008 Database

However, I am not able to see "Database Node" or "Database Diagrams" nodes as mentioned in the first and second steps.

Hence, how can I generate an ER diagram from an existing database?

From the comments, I realize that I was right in my understanding that Database node means the node with my database name. But then my problem is I am not able to find the "Database Diagrams" node under my Database name. What should I do so that I can see it?

PS: It’s not a local database.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Temp O'rary
  • 5,366
  • 13
  • 49
  • 109
  • what version of sql server are you using? – JamieD77 Sep 03 '15 at 14:59
  • `Database Node` refers to the name of your database.. once you connect to your server you should see Databases tree.. under that the actual names of your databases. drill into the database you want to create a diagram for and `Database Diagrams` should be under it. – JamieD77 Sep 03 '15 at 15:02
  • OK. So, I was right. But then my problem is I am not able to find the "Database Diagrams" node under my Database name. What should I do now so that I can see it. PS: Its not a local database. – Temp O'rary Sep 07 '15 at 10:42
  • 2
    https://msdn.microsoft.com/en-us/library/ms189279%28v=SQL.100%29.aspx `To use Database Diagram Designer, it must first be set up by a member of the db_owner role to control access to diagrams. ` – JamieD77 Sep 08 '15 at 20:14

4 Answers4

149
  1. Go to SQL Server Management Studio
  2. Object Explorer
  3. Databases
  4. Choose and expand your database.
  5. Under your database, right click on "Database Diagrams" and select "New Database Diagram".
  6. It will a open a new window. Choose tables to include in the ER diagram (to select multiple tables, press Ctrl or Shift key and select tables).
  7. Click Add.
  8. Wait for it to complete. Done!

You can save the generated diagram for future use.

Screenshot

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
DhaRmvEEr siNgh
  • 1,918
  • 2
  • 13
  • 17
  • Great! Do you @DhaRmvEEr siNgh know how to save the diagram as PDF/png file from SQL Management Studio? – Wojciech Jasiński Oct 30 '17 at 16:07
  • Remeber to upgrade your [Sql Server MAnagement Studio](https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms) – Jan-Terje Sørensen Nov 07 '17 at 07:36
  • 2
    @WojciechJasiński sorry I dont have that tool right now so not sure. But you can try "Open the database diagram and right click then select copy to clipboard (If available). Once on the clipboard open Paint and paste into a new image " – DhaRmvEEr siNgh Nov 22 '17 at 07:11
  • 9
    Warning: this is no longer supported. It is deprecated as of SSMS Version 18. – th3morg Mar 26 '19 at 14:14
  • Unfortunately after generating the diagram under db name/Database Diagrams from SSMS the only option is printscreen to save the whole diagram, but if you have many tables it lasts forever. The right mouse click menu/Copy Diagram to clipboard command copies only table structures without relations. – zakimatyi Mar 21 '19 at 10:39
  • Right click -> copy diagram to clipboard. Open your favorite image editor -> paste. – JDC May 09 '19 at 14:33
  • It's also saved in Database Diagram Folder...if u are created and Save – Raj G Nov 27 '19 at 06:34
  • 1
    It IS there in SSMS V18. However, you'll have to expand the particular DB and then there you'll see this exact option. – Xonshiz Sep 23 '21 at 13:59
21

Diagrams are back as of the 2019-06-11 release

Download the latest

As stated:

Yes, we’ve heard the feedback; Database Diagrams is back.

SQL Server Management Studio (SSMS) 18.1 is now generally available


Note: The latest version does not include it

Sadly, the last version of SSMS to have database diagrams as a feature was version v17.9.

Since that version, the newer preview versions starting at v18.* have, in their words "...feature has been deprecated".

Hope is not lost though, for one can still download and use v17.9 to use database diagrams which, as an aside for this question, is technically not an ER diagramming tool.


As of this writing it is unclear if the release version of 18 will have the feature. I hope so because it is a feature I use extensively.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • 1
    download older versions at: https://github.com/ktaranov/sqlserver-kit/blob/master/SSMS/README.md#sql-server-management-studio-download-links-and-release-info – XoXo Sep 17 '19 at 15:42
18

From Object Explorer in SQL Server Management Studio, find your database and expand the node (click on the + sign beside your database). The first item from that expanded tree is Database Diagrams. Right-click on that and you'll see various tasks including creating a new database diagram. If you've never created one before, it'll ask if you want to install the components for creating diagrams. Click yes then proceed.

SQLmojoe
  • 1,924
  • 1
  • 11
  • 15
  • OK. So, I was right. But then my problem is I am not able to find the "Database Diagrams" node under my Database name. What should I do now so that I can see it. PS: Its not a local database. – Temp O'rary Sep 07 '15 at 10:44
16

As of 2019-10, for SQL Server Management Studio, they did not upgrade it to add the create ER Diagram feature.

I would suggest try using DBeaver:

I am using both Mac and Windows and I was able to download the community edition. I logged into my SQL server database and was able to create the ER diagram using the DBeaver.

ER Diagram using the Community Version database viewer

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user3444999
  • 481
  • 4
  • 10