SQL SERVER – Download and Install Sample Database AdventureWorks 2005 – Detail Tutorial

This post is out of date. The download links and the steps below belong to an older version of SQL Server. I keep one current guide for both sample databases, and I update that one instead of this page.

Install AdventureWorks and WideWorldImporters: Updated 2026

Just a day ago I received a question from a reader who just installed SQL Server 2008. After the installation user did not find any sample database along with installation. The user wants to install the sample database which he is very much used to. Let us learn about Sample Database AdventureWorks.

Here is a quick tutorial how one can install the AdventureWorks database on your server.

In the year 2016 Microsoft has replaced AdventureWorks with WideWorldImports database. You can read about that over here: Download and Install Sample Database WideWorldImporters

Sample database is now moved to Microsoft’s open source site of Codeplex. Visit following link to visit the Sample Database page.

There are two different methods to set up sample database. 1) Running SQL Script 2) Restoring Database Backup. There are a few common steps in both the process. We will see the common process first and then after see both the method to set up a sample database in detail.

Common Steps:

Download the .msi package based on your operating system and your SQL Server version. I have used AdventureWorks DB version of 2005 as that is what was questioned from user. If you download version of 2008 it can only be installed in version of 2008.

Most of the images are self-explanatory so I will let images explain most of the details.

SQL Server 2008 AdventureWorks Database Scripts Setup Window.

User license agreement for SQL Server software.

Install SQL Server 2008 Dialog.

Finish button for SQL Server database script setup.

Right click context menu.

AdventureWorks Sample Database Files.

Above image displays the location where Sample Database is installed. Please note the location of the same database as “C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks OLTP“

Method 1 : Using T-SQL Script

Open SQL Server Management Studio and open the file instawdb from the location where sample database are extracted “C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks OLTP“.

Open File dialog box.

SQL Server 2005 sample database.

Now make sure that you find variable @data_path and change its values to the location of the database. This is very important task otherwise your database will be created with empty tables.

Set @sql_path TO locate your sample script exists.

Once the script is successfully running, following result set will be returned.

SQL Server Management Studio.

Check AdventureWorks database in object explorer.

Alt text 'SQL Server Object Browser window showing AdventureWorks and database objects.

Method 2 : Restoring Database Backup

This method requires to create empty database initially and then after restoring it from backup. Please pay attention to radio buttons and checkbox on the screen as it is very important to select the right options when restoring database.

Right-clicking on new database in SQL Server Management Studio.

Database file properties.

Add backup from device.

Location of Database backup is where sample database is extracted “C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks OLTP“.

Select file to backup.

Specify backup media and location.

The following screen is most important, make sure to select options displayed in the screen or database will not be restored.

Restore Database wizard window.

Restore Database Tool.

Check AdventureWorks database in the object explorer.

SQL SERVER Management Studio.

If you want to install AdventureWorks database version 2008, the methods works fine. There is an additional sample database are available in the same package and they can be installed in a similar way. If you want to install Northwind database follow my previous article SQL SERVER – 2005 NorthWind Database or AdventureWorks Database – Samples Databases – Part 2.

Let me know what is your experience while setting up a sample database with SQL Server 2008. Additionally, let me know what you think about this in-depth explanation of the process of setting up sample database.

Still need to install these databases? Everything above is kept for the record. The steps that work today, the current download links and the errors people actually hit are all on one page, and that is the page I keep up to date.

Install AdventureWorks and WideWorldImporters: Updated 2026

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.

Database, SQL Backup and Restore, SQL Download, SQL Sample Database, SQL Scripts, SQL Utility
Previous Post
SQL SERVER – Fix : Error : 1326 Cannot connect to Database Server Error: 40 – Could not open a connection to SQL Server
Next Post
Choosing Where to Put Data and Log Files

Related Posts

132 Comments. Leave new

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.