How To View Database Diagram In SQL Server

Viewing database diagrams in SQL Server is essential. In this article, I will walk you through all the approaches to do this.

How To View Database Diagram In SQL Server

Let us discuss all the approaches individually.

Approach-1: Using SQL Server Management Studio (SSMS)

To view database diagram in SQL server, follow the below steps.

1. Connect to your SQL Server instance using SQL Server Management Studio (SSMS).

2. Expand the Databases folder –> then Expand your specific database –> Now, expand the Database Diagrams folder as shown in the screenshot below.

How To View Database Diagram In SQL Server

You can double-click on the database diagram name to open it.

Check out How to Get Auto Increment ID in SQL Server

Approach-2: Using sysdiagrams

We can query the sysdiagrams for this purpose. We just need to execute the below query for this purpose.

USE Test;
GO
SELECT name AS DiagramName
FROM sysdiagrams;

After executing the above query, I got the expected output below.

how to view database diagram in sql server management studio

Conclusion

Viewing database diagrams in SQL Server is an essential skill. You can either use the SQL server management studio (SSMS) design approach or you can also query the sysdiagrams as mentioned in this article.

You may also like following the articles below.

Top 200 SQL Server Interview Questions and Answers

Free PDF On Top 200 SQL Server Interview Questions And Answers

Download A 40 pages PDF And Learn Now.