Sunday, September 14, 2008

How to install adventureworks on SQL Server 2008

1. download and run the SQL2008.AdventureWorks_OLTP_DB_v2008.x86 from http://www.codeplex.com/MSFTDBProdSamples

The program does not actually attach the database to sql server. It only creates a backup that can be restored. You now will need to do some additional configuring to SQL Server.

2. You need to enable FILESTREAM
http://msdn.microsoft.com/en-us/library/cc645923.aspx

3. Next run the following script

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

4. Finally, you run a script that restores the backup of the installed database.

C:\Program Files\Microsoft SQL Server\100\Tools\Samples
Open RestoreAdventureWorks2008 and modify the set path:

SET @source_path = 'C:\Program Files\Microsoft SQL Server\100\'

Now, you should be able to run the TSQL and the database will be created in the following folder
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA

Remember to refresh your database listing.

No comments: