AdventureWorks Database for SQL Server 2008

VmtVigram
VmtVigram used Ask the Experts™
on
I've downloaded SQL2008.AdventureWorks_All_Databases.x86.msi from the CodePlex website. I haven't installed any previous AW databases.

When I run the installer, it gets to the page where I select the instance to install to - I select my only instance, the default instance "MSSQLSERVER (Engine)".  The "Next" button is greyed out - if I click back, then click next to return to this dialog, the Next button is now enabled but very soon after clicking it, I see a dialog telling me that the "Microsoft SQL Server 2008 AdventureWorks Databases Refresh 3 Samples (x86) Setup Wizard ended prematurely due to an error".
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
Kindly download the SQL2008.AdventureWorks_All_Databases.zip file in the given link.

http://msftdbprodsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34032

-- Direct download link

http://msftdbprodsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34032#DownloadId=86540

Just extract from the zip file and attach MDF and LDF files directly..
Commented:
There is a note when you are trying to install SQL Express which is marked "Important", near the top of the pre-requisites page, advising Express users to install the Advanced Services, and also a link to the download.
To install the AW OLTP database, download the zipped version on SR3, and unzipp the contents into a folder. Copy the samples folder in the root of your unzipped folder into "C:\Program Files\Microsoft SQL Server\100\", and then dril into the Tools folder within the unzipped folder, and copy the Samples folder within that into "C:\Program Files\Microsoft SQL Server\100\Tools".

Open SQL Management Studio, connect to the instance, and open "C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks 2008 OLTP\instawdb.sql".

Before you run it go to the Query menu and select SQLCMD Mode, and in the query itself uncommentthe two ":setvar" lines (lines 39 and 40). Run the entire script and after a few moments, it will be successfully installed and you can see the AdventureWorks2008 database in your object explorer

Hope this helps!

Author

Commented:
I followed your suggestion but the query returned an error:

*** Creating Database
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Data.mdf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
** An error was encountered during execution of batch. Exiting.

I cannot find the MDF file after unzipping.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Commented:
The error
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Data.mdf" failed with the operating system error 3(The system cannot find the path specified.).

indicates that restore can not find the path:

C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\

You either need to create the path yourself, or:

1. use "WITH MOVE" in the T-SQL

or

2. use the GUI to specify an alternate location for each database file
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
>> Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Data.mdf" failed with the operating system error 3

Kindly check whether SQL Server service is running under local system account or not.
If not, then if you go to Security and logins and you would find these logins

sqlserver2005MSSQLUser$computername$MSSQLServer and sqlserver2005SQLAgentUser$computername$MSSQLSERVER

Just copy these users and right click C:\Program Files\Microsoft SQL Server and then grant full privilege to both these users to get it fixed.

Author

Commented:
geekvj: It works now. I can see the AdventureWorks DB in the Object Explorer.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial