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
I installed Microsoft SQL server 2008 I have adventure work database that I want to install, I am not sure how to install it can u give more description of how to do it.
Trying to install the adventure work dbase using the 2nd method however i am not locating the backup file. I am using the installer packaged dwnloaded from codeplex. Is there something i am doing wrong as this is getting VERY frustrating.
need sql server software
Danish Ahmed Siddiqui
Unable to open the physical file “D:\Tech\umbraco\build\App_Data\umbraco.mdf”. Operating system error 5: “5(Access is denied.)”. (Microsoft SQL Server, Error: 5120) please help me on it
Thanks!
Hi want to download SQL Server 2008 Express Edition, how do i go about it please help
link is dead
The specified release was not found. on link
link is down
Can any one suggest a good site to learn SQL Server 2008. There are many articles in the web, most of them will jump into conclusion too soon….
Thanks in Advance!!!
Atique
Sir kindly tell me the procedure how i use adventure works sample files in my real environment.Thanks
i want to download SQ L server 2008
I m finding difficulty to attach all sample databases download from code plex,
Error message displays as version of sql currently is lower version 661
the server supports 654 version .
could u provide Downloadlink .
thanks alot
i want to download adventureworks but i dont now how to download
For all those who want to download SQL Server 2008, Express editions are available for free at Microsoft Download Centre website. Here is the direct link to download SQL Server 2008 R2 Service Pack 2 – http://www.microsoft.com/en-in/download/details.aspx?id=30438
Similarly, R1/SP1 for 2008 and previous versions of SQL Server are also available.
Please read the overview section and the information below that to understand the best product suitable for your use as there are multiple options available for download at each link (for e.g. SQL Server 2008 R2 Express with Tools / with Advanced Services / (Runtime Only) / Management Studio Express)
P.S. – A little bit of google search before asking for help never hurts.
Hi,
I have add to above sample database but it always shows that it is read only.
Can someone help me ?
Can you please share the link of SQL server 2008 standard edition for download.
oh thank you. i were searching for this one. Before i download this i coudn’t attach the adventure works.mdf file. Now am happy to see this adventureworks.BAK file……thanks alot
Thanks!