Sample SQL Server database for 2012 Adventure Works Download

Leave a comment (0) Go to comments

As I said, my virtual environment was expired so I need to rebuild that all over again. So here is

STEP BY STEP Guide for Downloading and Attaching SQL Server 2012 Sample Database

STEP 1 – DOWNLOAD AdventureWorks2008R2 Data File 

**This is approx 188 MB of file might take couple of second

STEP 2 – ATTACH downloaded SQL Server Adventure Works Sample database for 2012 to SQL Server

Quick note, the file which we downloaded is just a data file, so we can not attach or install this file. We need to manually attach this Data file to SQL Server to build a AdventureWorks Sample Database.

To build a database from a data file, we need to ATTACH Database data file, to  attach, Right Click on SSMS >> Database >>> ATTACH

Sample SQL Server database for 2012 Adventure Works Download sql server sample database download sample sql server database


In attach Window Locate a Data file which we downloaded in STEP 1

Sample SQL Server database for 2012 Adventure Works Download sql server sample database download sample sql server database

In the Attach Databases window; We will see that SQL Server informs us that the log file is not found. In order to attach the database without Database LOG File, we need to select the file as highlighted in the below snippet and click the "Remove" button and finally click OK to attach AdventureWorks database without the transaction log file and click OK

Sample SQL Server database for 2012 Adventure Works Download sql server sample database download sample sql server database

Sample SQL Server database for 2012 Adventure Works Download sql server sample database download sample sql server database

This will create a New database to our SQL Server as expected.

Sample SQL Server database for 2012 Adventure Works Download sql server sample database download sample sql server database

Alter natively, Instead of Graphical tool, we can run the following TSQL Script to attach SQL Server 2012 Sample Database, which I like the most and fast.

USE [master]
GO
CREATE DATABASE [AdventureWorks2008R2] ON 
( FILENAME = N'C:\MSSQL\Data\AdventureWorks2008R2_Data.mdf' ),
FOR ATTACH_REBUILD_LOG ;
GO

 

EOF - Sample SQL Server database for 2012 Adventure Works Download, SQL Server 2012 , 2008 R2 , 2008 , 2005 , 2000

Leave a Reply

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


*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.