MS SQL Server: Database Diagrams

MS SQL Server comes with a function called Database Diagrams. You can use it to produce ERDs (Entity Relationship Diagrams).

Start by right clicking on Database Diagrams > New Database Diagram in the Object Explorer


If you get the following error, you database does not have an owner assigned.


To assign an owner, right click on your database name and select Properties


Under Select a page > FilesBy Owner select radio button> Browse


Select your user name from the list and then hit Okay until you are back to the main screen.


Right click Database Diagrams > New Database Diagram


Click Yes


Now select some tables. In this example, I am choosing Employee and SalesPerson


The diagram shows the tables you picked, and the data fields. It also shows connections.


Notice the tables do not all connect directly with each other. Another point to take note of is the small yellow keys located in from of some fields. These let you know that those fields are the primary key(s) for their respective table. The primary key is the unique identifier for the table.


One thought on “MS SQL Server: Database Diagrams

  1. Hi, Neat post. There is a problem together with your web site in web explorer, may test this?
    IE nonetheless is the marketplace chief and a good part of people will pass over your great writing due to this problem.

Leave a Reply