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.
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“.
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.
Once the script is successfully running, following result set will be returned.
Check AdventureWorks database in object explorer.
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.
Location of Database backup is where sample database is extracted “C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks OLTP“.
The following screen is most important, make sure to select options displayed in the screen or database will not be restored.
Check AdventureWorks database in the object explorer.
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.
Reference : Pinal Dave (https://blog.sqlauthority.com)
132 Comments. Leave new
Nice and good information, i need this info thanks
my sqlserver don’t be installing this masassage always show when i need installing and i can’t solved this problem
the massage is “rule “pervious releases of microsoft visual studio2008″ failed
a pervious realease of microsoft visual studio2008 is installed on this computer . upgrade microsoft visual studio 2008
to the sp1 before installing sql server 2008”
i need help please
Nice write up. Very informative.
Congratulations, very clear your article.
I want to sql server2008 for use my compony
hi thanks for the information placed in ur blog
it helped me a lot in installing adventure works in my sql server data base
i appreciate the way u share data with every one
thx alot
Hi, when installing the AdventureWorks2008_SR4 i have this error:
Fatal error occurred during installation. Details:
Error de la inicializacion del objeto 8ISupportInitialize.EndInit). Error al recuperar un generador de classes COM para el componente con CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} debido al siguiente error: 80004002. Error en el objeto ‘DatabaseSelection’ en el archivo de marcado ‘DatabaseInstaller;component/databaselection.xaml’ Linea 78 Posicion 3.
Im using win7 ent. 32bit
thank you, this post saved me a lot of time. :)
instructions are precise and concise
tyvm
I just wanted to add my thanks to all the others.
I was in dispair and then found this.
Just one point when the instanwind.sql file was loaded in SQL server there was no occurrence of SET @data_path so I was thinking “oh oh, here I go again”, but being desparate I ran it anyway and it worked.
It was there in my databases and eventually I could connect to it after I had reversed some configuration settings I had tried earlier.
Now I can connect in Visual Studio too.
Thanks again.
Patrick
can’t find the @data_path variable. will u plz mention in which line it is?
thanks in advance,
syamantak
no commamt
i want sql server now
Google it and try downloading it from the one you feel right.
Sorry, but I do not see any of these install files under Downloads & Files as the codeplex site
Thanks
i need download link where is it
I have been trying to install the Sample Databases for SQL Server 2008 as suggested by you. The link “CodePlex SQL Server sample Databases” displays the following message:
“This page has moved, please wait while we redirect you to the new page”.
Please tell me from where I can download the sample databases for SQL Server 2008 Express
I have been searching for AdventureWorks DB and Northwind DB. But I could not find both. Can anybody specify the Link to Download these DBs.
Thanks.
Awesome material, thank you very much for the info.
Can you please give me the link to download AdentureWork Sample Database for SQL 2008, PLEASE.
hello sir,
kindly plz suggest me a site through which i can download the free SQL SERVER..
plz do let me know the full version and the path so that i can download it right away as it seems to very complicated..
Thanking You,
yours sincerely
rebecca gurung
date-31-07-2010