SQL Server Database Diagram Tool In Management Studio
Có thể bạn quan tâm
Problem
There are many complex tools to create database diagrams. These are not necessary to create simple database diagrams, print them or convert to a Microsoft Word or PDF document to share with your team. In this tip, we will walk through how to create a database diagram using SQL Server Management Studio (SSMS).
Solution
Using Microsoft’s sample database WideWorldImporters, I will demonstrate creating a simple database diagram of a limited number of tables focusing on Invoice related tables in the database. Next, I will copy the Database Diagram to MS Word to save and print it.
Step 1 – New Database Diagram using SQL Server Management Studio
In SSMS under the database WideWorldImporters, right click “Database Diagrams” and select “New Database Diagram”.

Step 2 – From Database Diagram – Select a table
From the Database Diagrams tool dialog, scroll and select the Invoice table and press Add and then Close.

Step 3 – From Database Diagram – Add Related tables
Right click the Invoices table and select “Add Related Tables“. This automatically adds tables linked to the Invoices table by Foreign Keys of which the Invoices table is a foreign key.

Step 4 – Eliminate Unwanted Tables from the Diagram
Right click on any table that might clutter the diagram and that you feel is not important and select “Remove From Diagram“.

Step 5 – From Database Diagram – Auto Arrange Tables
Right click the Invoices table and select “Arrange Tables“. This organizes the tables with out overlapping.

Step 6 – From Database Diagram – Adjust the Layout
To adjust the layout, do the following:
- Right click to select a Zoom level to see your tables.
- Drag a table to adjust the positioning.
- Click a table and put the cursor on the edge to resize the table layout.

Step 7 – From Database Diagram – Auto Size All Tables
Use CTRL + A to select all tables. Right click any highlighted table and select “Autosize Selected Tables“. Select and drag the connector lines to rearrange.

Step 8 – SSMS Export Database Diagram with Copy Diagram to Clipboard Option
Once the Diagram is sized and arranged as desired, hit Save and give your Diagram a name. Right click any white space in the Diagram and select “Copy Diagram to Clipboard“.

Step 9 – Paste the Diagram to MS Word
Open Microsoft Word. Insert a single cell Table and paste the Database Diagram in the cell.

Step 10 – In Word Adjust and Maximize the Database Diagram Image
Adjust the Word document to maximize the database diagram image. Change the margins to .5 inch, enter the image and resize it to enlarge. Below is a snippet from a Word document Database Diagram.

Wrap Up
Once the diagram is in Word you can print it, share it, or save as a Word Doc or PDF file. This is an effective way to create simple limited Database Diagrams that can be leveraged when documenting your database. I find creating partial database diagrams around logical groups of tables a good way to document a database. Other options that can be done in SSMS Database Diagrams include showing Table Names and Relationships. You can also display just the Key Columns to make larger models easier to read.
Next Steps
- Check out more on Reverse engineering a database
- For addition details about SSMS Database Diagrams read Getting Started with SQL Server Database Diagrams
- Learn more about Working with Database Diagrams from Microsoft SQL Docs
- Check out these other articles for SQL Server Management Studio
Từ khóa » Visual Studio Database Diagram Designer
-
Open Database Diagram Designer - Visual Database Tools
-
Set Up Database Diagram Designer - Microsoft Docs
-
Set Up Database Diagram Designer - Visual Database Tools
-
Open Database Diagram Designer - Visual Database Tools
-
How To Open Database Diagram In Visual Studio 2017 - Stack Overflow
-
Use Visual Studio To Create Database Diagrams.
-
Set Up Database Diagram Designer (Visual Database Tools) - GitHub
-
Top 5 Free Database Diagram Design Tools (Updated) - Holistics
-
8 Best Database Diagram Tools - Comparitech
-
Visual Database Designer For SQL Server - Data Modeling Tool - Devart
-
5.2 Database Diagram Designer
-
Examining Visual Studio Database Developer Tools - ITPro Today
-
How To Create A Database Diagrams In Visual Studio Code - ADocLib