How To: Download and install AdventureWorks database for SQL Server 2008

1. Download AdventureWorks 2008 OLTP file from below link.

2. Extract zip file into “AdventureWorks 2008 OLTP Script” folder.

3. In the Script folder you will find collection of .csv files and one AdventureWorks DDL script file named “instawdb.sql”.

4. Open instawdb.sql DDL Script File in SQL Server Management Studio.

5. Update the DDL script path variables (See Fig 1).


Fig. 1

Fig. 1 shows instawdb.sql DDL script file in SSMS. This script depends on two path variables SqlSamplesDatabasePath and SqlSamplesSourceDataPath. SqlSamplesDatabasePath will take path of the folder where AdventureWorks database files will be stored after installation while SqlSamplesSourceDataPath should be set with the actual path of “AdventureWorks 2008 OLTP Script” folder where you have all the csv files in your system. Before running this script in SSMS, You should uncomment setvar commands of both path variables and also both path variables should be set with necessary and appropriate values(As specified in Fig. 1 above). An invalid SqlSamplesSourceDataPath path will generate an error that the bulk load steps failed because the .csv files could not be found.

6. Run DDL Script only in SQLCMD mode. On the Query menu click on SQLCMD Mode. You will find SQLCMD mode menu in Query -> SQLCMD Mode in SSMS.


Fig. 2

7. On a SSMS toolbar click on Execute or Press F5 to execute DDL script.

After successful execution of DDL script you will have the AdventureWorks database in your SQL Server 2008 Instance.


I will show you other methods of installing AdvantureWorks database in SQL Server 2008, in my future posts.

Please share your thoughts in the comment section.

Enhanced by Zemanta

About Ashish Jain

I am Ashish Jain, a software engineer by profession. My goal of creating this blog is to share my knowledge of SQL server with all other SQL enthusiasts and also to learn from them.
This entry was posted in SQL Administration and tagged , , , , , , , . Bookmark the permalink.

One Response to How To: Download and install AdventureWorks database for SQL Server 2008

  1. Pingback: How To: Find all objects, referencing a single object or all objects, referenced in a single object in SQL Server Database | SQL Destination

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s