AdventureWorks Databases – 2012, 2008R2 and 2008

Rating:        Based on 26 ratings
Reviewed:  26 reviews
Downloads: 643946
Released: Aug 28, 2012
Updated: Nov 14, 2012 by DerrickVMSFT
Dev status: Stable Help Icon

Recommended Download

Example AdventureWorks2012_Database.zip
example, 37158K, uploaded Aug 29, 2012 - 202978 downloads

Other Available Downloads

Example AdventureWorksLT2012_Database.zip
example, 1131K, uploaded Aug 29, 2012 - 32994 downloads
Example AdventureWorks2008R2_Database.zip
example, 36098K, uploaded Aug 29, 2012 - 198963 downloads
Example AdventureWorksLT2008R2_Database.zip
example, 1028K, uploaded Aug 29, 2012 - 52620 downloads
Example AdventureWorks2008_Database.zip
example, 58410K, uploaded Aug 29, 2012 - 124867 downloads
Example AdventureWorksLT2008_Database.zip
example, 1353K, uploaded Aug 29, 2012 - 31524 downloads

Release Notes

About this release
This release consolidates AdventureWorks databases for SQL Server 2012, 2008R2 and 2008 versions to one page. Each zip file contains an mdf database file and ldf log file. This should make it easier to find and download AdventureWorks databases since all OLTP versions are on one page. There are no database schema changes.

For each release of the product, there is a light-weight and full version of the AdventureWorks sample database. The light-weight version is denoted by the LT abbreviation in the filename.

An AdventureWorks database can be installed by attaching the database, or using the CREATE DATABASE statement.

To attach an AdventureWorks database
  1. Download a database for your SQL Server version.
  2. Unzip the database (mdf) file and log (ldf) file.
  3. From Microsoft SQL Server Management Studio, connect to a SQL Server instance.
  4. Right click Databases.
  5. Click Attach.
  6. Click the Add button.
  7. Locate the AdventureWorks database mdf file. For instance, AdventureWorks2012_Data.mdf.
  8. Click the OK button on the Locate Database Files dialog window.
  9. Click the OK button on the Attach Databases dialog window to attach the database.
CREATE DATABASE statement
From SQL Server Management Studio, execute the following T-SQL:

Example T-SQL
CREATE DATABASE AdventureWorks2012 ON (FILENAME = 'M:\Data\AdventureWorks2012_Data.mdf'), (FILENAME = 'L:\Tlogs\AdventureWorks2012_Log.ldf') FOR ATTACH;

Reviews for this release

     
I downloaded this code with reference from book - first edition of SQL Server Execution Plans Grant Fritchey. I downloaded AdventureWorks db from this link, But most of the scripts like below (mentioned in Chapter 2 under Table Join) are not running in that db because all the tables are missing under AdventureWorks database. SELECT e.[Title], a.[City], c.[LastName] + ', ' + c.[FirstName] AS EmployeeName FROM [HumanResources].[Employee] e JOIN [HumanResources].[EmployeeAddress] ed ON e.[EmployeeID] = ed.[EmployeeID] JOIN [Person].[Address] a ON [ed].[AddressID] = [a].[AddressID] JOIN [Person].[Contact] c ON e.[ContactID] = c.[ContactID]; I tried to download all versions of AdventureWorks database like 2012\2008R2 etc but no luck. Can you please help me to get the real sample code. I’ll really appreciate your help on this.
by Gaurav08 on Jun 4 at 7:46 PM
     
5 stars is rated
by mirzakashifzaman on May 7 at 1:57 PM
     
Terrific! So much easier to Attach with a provided log file.
by eugeneandres on Apr 26 at 6:51 PM
     
Instructions ran fine AFTER I launched SQL Server 2012 in Win7 as ADMINISTRATOR. Enjoy.
by DerekIT on Dec 13, 2013 at 3:40 PM
     
Great DB, matches all M$oft sample code, and was a snap to get loaded on Express 2008R2
by djonesii on Nov 27, 2013 at 2:46 PM
     
Only problem I encountered using SQL Server 2012Express (on Windows 8.1) was trying to attach the database I downloaded to my local drive (received error message similar to others in this review). Once I copied the database to a flash drive I was able to locate and attach with no problem at all. Great database - thanks!
by ValerieD on Nov 3, 2013 at 3:54 PM
     
Not sure what people are griping about...I had NO problem downloading or attaching the database. NO PROBLEM!!
by ansonee on Sep 20, 2013 at 7:08 PM
     
Anyone please provide me text file of script AdventureWorks2008 or 2008R2, i am unable to attach or restore the files downloaded from this page, razasyedcse@hotmail.com, Kindly.
by razasyedcse on Sep 18, 2013 at 6:47 AM
     
Definitely a complete and very solid autoscaling solution! Great job!!
by travisbarker on Aug 27, 2013 at 9:47 AM
     
Excellent!, Thanks!.
by jordenysp on Aug 23, 2013 at 1:19 PM
     
Not a problem at all. Attached to SQL server easily.
by Rajanand on Jul 13, 2013 at 1:56 PM
     
No problems at all dowloading AdventureWorks2012_Database.zip and using the sample T-SQL code above to create the database.
by jhrozo on Jun 16, 2013 at 3:44 AM
     
There are many copies of these MDFs floating around and several steps to allow some of them to attach. With the 2008LT and 2012LT versions it was very easy to attach them to my named instance logging on as LocalSystem with Filestream enabled. Not sure all that was required, but I went through three attempts to get a test db installed fast. Thanks.
by ewascent on May 19, 2013 at 2:43 AM
     
I am not able to attach database AdventureWorks2008R2 with SQL Server 2008R2. It gives this error: The database 'AdventureWorks2008R2' cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported. Could not open new database 'AdventureWorks2008R2'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948) Please help!
by Richagupta1985 on May 7, 2013 at 11:34 AM
     
Simple. Nice. Clean. Thank you
by KRob636 on May 4, 2013 at 8:39 PM
     
I downloaded the db for the article on DM the first example was executing a vTargetMail is not in this version. Plus the script error from the article. SELECT * FROM [AdventureWorksDW.[dbo.[vTargetMail I value this site but come on lets get the examples working.
by steve_witt on Apr 15, 2013 at 2:00 PM
     
Sweet! Worked perfectly. I copied the files and simply used right-mouse-->Attach... to create the database. Thank you for supplying this and I feel sorry for those that feel the need to be bitter and cynical when this is a free service.
by pguidogl on Apr 5, 2013 at 1:11 PM
     
Was able to download and attach DB without any issues. Imported tables, and view. Play time!
by adeelsansari on Apr 4, 2013 at 5:26 PM
     
Im using windows 7 32bit os. I have installed sql server 2008 release 2 for 32 bit os. when im trying to install the AdventureWorks 2008r2 and i attach the mdf file the following error is shown: 'AdventureWorks2008' cannot be opened because it is version 661. This server supports version 655 and earlier PLEASE HELP. URGENT IS THERE ANY VERSION FOR 32 BIT OS. HOW DO I ATTACH THE DATABASE????????
by arnesh on Apr 3, 2013 at 4:05 PM
     
I have to ask does any one test this stuff for accuracy. When I try to attach it says: CREATE DATABASE AdventureWorks2008R2 ON (FILENAME = 'F:\MSSQL10.SQL01\MSSQL\DATA\AdventureWorks2008R2_Data.mdf'), and 'R:\MSSQL10.SQL01\MSSQL\Data\AdventureWorks2008R2_log.ldf' are both primary files. A database can only have one primary file.
by klovefan4ever on Mar 7, 2013 at 3:40 AM
     
The Data is crap. I have been trying to Develop a cube. They have changed the Database table names in AdventureWorks2008R2 Database . But the Cube that they provide is still based on old tables. I am not able to find the DW version of the data base found http://msftdbprodsamples.codeplex.com/releases/view/59211 After so one whole day.
by vinodaggarwal87 on Feb 16, 2013 at 5:49 PM
     
3 stars since I have not tried 2008 and 2008R2. These mdf and ldf files worked as expected but the ones from your other site http://msftdbprodsamples.codeplex.com/releases/view/55330 did not.
by 1mysorian2 on Jan 17, 2013 at 10:37 PM
     
university
by zns_91 on Oct 29, 2012 at 6:25 PM
     
Your little code snippets are wrong! You have single-quotes at the END of each filename, but not at the beginning. You can even tell because what is in red is not right. Maybe if you weren't so dang abstract! Here's a clear example: CREATE DATABASE AdventureWorks2012 ON (FILENAME = 'M:\Data\AdventureWorks2012_Data.mdf'), (FILENAME = 'L:\Tlogs\AdventureWorks2012_Log.ldf') FOR ATTACH;
by jpSQLDude2 on Oct 24, 2012 at 7:33 PM
     
Derrick - Can you please tell us what has changed in this release? Thanks.
by emerald77 on Aug 29, 2012 at 8:10 PM
     
The database 'AdventureWorks2008R2' cannot be opened because it is version 661. This server supports version 662 and earlier. A downgrade path is not supported. Could not open new database 'AdventureWorks2008R2'. CREATE DATABASE is aborted. (Microsoft SQL S
by shuggie on Nov 4, 2013 at 8:51 AM