Installing Microsoft SQL Server AdventureWorks Sample Data

Leave a comment

Microsoft provides sample SQL Server databases called AdventureWorks. You can download the files from the CodePlex website for your relevant SQL Server version here – http://msftdbprodsamples.codeplex.com/.  You can then attach the databases to your SQL Server instance. To do this, copy the files to a location on the SQL Server and run the following command:

CREATE DATABASE [AdventureWorks2012]
ON (FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorks2012_Data.mdf’)
FOR ATTACH_REBUILD_LOG
GO

CREATE DATABASE [AdventureWorksDW2012]
ON (FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2012_Data.mdf’)
FOR ATTACH_REBUILD_LOG
GO

Once complete, the sample databases will be installed.

 

 

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *

16 − four =