This article will tell you about creating ER diagrams in SQL Server management studio. ER diagrams (entity relationship diagrams) describe static structure of database tables. Just like when building a house, the construction master needs the project documents, database specialists also need their ERD to build the database on strong foundation.
ERD is part of the documentation. It is used mainly in early phase of a project. We will also use them throughout the lifetime of the database. It is not so easy to orientate in the database if we have a larger number of objects in it.
Many analytics, report builders or even stakeholders will appreciate possibility to see which objects to work with so they can get to what they need.
Creating ER Diagrams in SQL Server Management Studio
I must admit I do not like to make diagrams in management studio and rather use different tools. If you compare mysql Workbench client to SQL Server management studio feature, the latter comes out much worse. It is confusing and does not offer many functionalities. But it is sufficient for basic overview and data modeling of small projects.
Possibility to create descriptions at tables and attributes is a sure thing as is foreign key creating and change of some features of table directly from the diagram.
1) ER diagrams can be found under database in Database diagrams
2) After opening the diagram, select which to display in the diagram. We can add tables using Add option from the list.
Evaluation In The End
As you can see, diagrams hold their place in SQL Server regardless its flaws. We cannot recognize foreign keys in the diagram – no links lead to it and the fields are not distinguished in different color.
You will have to track the foreign keys from the systematic tables if you do not have naming convention in the table. There can be seen cardinality in limited amount. But I personally miss possibility to define if the N can be empty in 1:N relationship.