Generate or Download Latest SQL Server AdventureWorks Database Diagram

Training using the latest Microsoft SQL Server AdventureWorks database and need the latest database diagram?

As of when this article is written, the latest AdventureWorks database is AdventureWorks2017, found here.

So here you go. Image above is showing the latest AdventureWorks2017 database diagram, however FYI, the database diagram shown above doesn’t have complete set of AdventureWorks tables – I just select what I needed.

But don’t worry, in case the diagram isn’t sufficient for your work, here I’ll show you how to generate the database diagram yourself. And the good thing is that, this steps is regardless of which version of the AdventureWorks is and also can be used to generate database diagram for other databases as well.

Generate Latest AdventureWorks Database Diagram (works too for any databases)

1) Ensure you have SQL Server up database and running, ensure too you have the SQL Server Management Studio (SSMS).

2) Ensure you have restored AdventureWorks database (refer here for detail steps).

3) Open SSMS then open and expand the AdventureWorks database (or any other database you want to generate the database diagram).

sql server generate new database diagram
SQL Server – Create New Database Diagram

4) On the expanded database view, go to Database Diagrams, do right click then choose “New Database Diagram”.

sql server database does not have database diagram prompt
Click Yes when prompted to create a new Database Diagram – SQL Server

5) When prompted, “This database does not have one or more support objects required to use database diagramming. Do you wish to create them?”, click “Yes”.

sql server database diagram add table
My recommendation is to select only tables that you need

6) Select the tables you want to see the relationship among them and and show as database diagram. Do click on “Add” on the tables you need. My recommendation here is to just select tables that you need. Selecting all the tables altogether will cause the database diagram to appear tangled and complicated. Click “Close” once done.

7) Database diagram shall be created and the linkages between the tables (if they are connected one to another) will also shown.

sql server database diagram arrange table
Click on Arrange Tables to arrange the Database Diagram tables – SQL Server

8) If needed to arrange the tables, do right click on the empty space, and choose “Arrange Tables”. If the auto-arrangement is not good enough for you, you can arrange yourself.

That’s it! You can redo step #3 to step #8 above on any database you have on SQL Server.

SQL Server Error: 15517, Principal “dbo” does not exist

When restoring AdventureWorks database (or any other database) then tried creating Database Diagram, you may get this error, “Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission. (Microsoft SQL Server, Error: 15517)”, typically the error is because the database owner isn’t the same as the user you are using to login to database.

sql server error 15517 when creating database diagram
You may encounter Error 15517 when creating Database Diagram – SQL Server

Run the following command to resolve the issue.

use <database_name> EXEC sp_changedbowner ‘<login_id>’

If the database is “AdventureWorks2017” and the login id used is “sa”, this is the command you need to run on SSMS.

use AdventureWorks2017 EXEC sp_changedbowner ‘sa’

Do you have anything you want me to cover on my next article? Write them down on the comment section down below.

Alternatively, find more interesting topics on JILAXZONE:

How-ToPositive Cash FlowAndroid
TravelAll articlesiOS & iPhone

JILAXZONE – Jon’s Interesting Life & Amazing eXperience ZONE.

Hi, thanks for reading my curated article. Since you are here and if you find this article is good and helping you in anyway, help me to spread the words by sharing this article to your family, friends, acquaintances so the benefits do not just stop at you, they will also get the same goodness and benefit from it.

Or if you wish, you can also buy me a coffee:

Thank you!

Live to Share. Share to Live. This blog is my life-long term project, for me to share my experiences and knowledge to the world which hopefully can be fruitful to those who read them and in the end hoping to become my life-long (passive) income.

My apologies. If you see ads appearing on this site and getting annoyed or disturb by them. As much as I want to share everything for free, unfortunately the domain and hosting used to host all these articles are not free. That’s the reason I need the ads running to offset the cost. While I won’t force you to see the ads, but it will be great and helpful if you are willing to turn off the ad-blocker while seeing this site.

Leave a Reply

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

Comment moderation is enabled. Your comment may take some time to appear.