If you have a large database and want to create a database diagram showing only the keys, this is possible by using the Microsoft SQL Server Management Studio:

In this example I used the Advantureworks 2008 R2 example database:

 

  • Open Microsoft SQL Server 2008 R2 Management Studio and connect to the AdventureWorks database (http://msftdbprodsamples.codeplex.com/)
  • Right click Database Diagrams and choose [New Database Diagram]

 

image

 

  • Add all tables to you’re diagram, by selecting all tables clicking Add and then click Close

image

 

  • Select all tables by pressing Ctrl + A

image

 

  • Right click a table and click Table View > Keys

 

image

 

Result

image

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.