Learn more about SQL Server tools

 

Tutorials          DBA          Dev          BI          Career          Categories          Videos          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Events

DBA    Dev    BI    Categories

 

Install Your Own Copy of the SQL Server AdventureWorks2014 Database


By:   |   Read Comments (1)   |   Related Tips: More > Testing

Problem

I see all of these examples using the AdventureWorks SQL Server database, how can I get my own copy?

Solution

Microsoft provides a backup of the AdventureWorks2014 database on its CodePlex website. The 2014 version of the AdventureWorks databases can be found at the following link: Adventure Works 2014 Sample Databases. There are multiple zip files on this web page for both the OLTP AdventureWorks2014 database and the dimensional model for data warehousing named AdventureWorksDW2014.

Adventure Works 2014 Sample Databases

In this tip, we will download the Adventure Works 2014 Full Database Backup.zip file as shown above. Unless you have changed your browser's settings, the zip file will download to your Downloads folder.

Once the download has finished, you have to extract the contents of the zip file. The zip file contains a single SQL Server backup file with a .bak extension named AdventureWorks2014.bak.

Extracted backup file

After extracting the file, copy the file to your database instance's Backup folder. You might get the following pop-up message, since I am the administrator on my own PC, I clicked on Continue.

Security question for permissions

In SQL Server Management Studio (SSMS), right-click on "Databases" and choose "Restore Database..." to bring up the Restore Database window.

right-click on Restore Database...

In the Restore Database window, we have to specify the AdventureWorks2014.bak file that we have extracted and moved into the database instance's Backup folder. In the Source groupbox, click on the Device radio button and then click on the ellipsis to the right as shown below.

In the Source groupbox, click on the Device radio button and then click on the ellipsis

In the Select backup devices window, the Backup media type is File. We need to click on the Add button.

Click Add in the Select backup devices window

In the Locate Backup File window, navigate to your database instance's Backup folder. Select the appropriate backup file. As shown here AdventureWorks2014.bak and AdventureWorksDW2014.bak reside in the Backup folder. Click on AdventureWorks2014.bak and then click on OK. This will return you to the Select backup devices window.

Locate the backup file

In the Select backup devices window, the path and filename to AdventureWorks2014.bak should now appear. Click on OK to close the Select backup devices window and return to the Restore Database window.

Select backup devices

In the Restore Database window, the database name will be populated. Click on OK to begin the restoration process. A progress bar will appear at the top of the window.

Click on OK to begin the restoration process

Upon successful completion, the following window will appear. Click on OK.

Database restored successfully

Go to the Object Explorer in SQL Server Management Studio and browse the objects in AdventureWorks2014. If the AdventureWorks2014 database does not appear, right-click on Databases and choose Refresh.

AdventureWorks2014 database objects in SSMS
Next Steps

Similar steps can be followed to restore the AdventureWorksDW2014 database to your computer. Also, check out the following tips on database backup and restoration.



Last Update:






About the author
MSSQLTips author Dallas Snider Dr. Dallas Snider is an Assistant Professor in the Computer Science Department at the University of West Florida and has 18+ years of SQL experience.

View all my tips


 









Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Notify for updates 


Get free SQL tips:

*Enter Code refresh code     



Friday, June 24, 2016 - 2:37:22 PM - Norm Back To Top

 

Of all the long drawn out crap out there to install the AdventureWorks database I finally found this explaination and not only is this the most efficient it's also the easiest.


Learn more about SQL Server tools