SQL SERVER – Installing AdventureWorks for SQL Server

I just began with SQL Server 2012. The very first thing, I realized that there is no AdventureWorks Sample Database available for Denali. I quickly searched online and reached to Microsoft documentation where it provides information on the how to install (restore) AdventureWorks for SQL Server .

  1. Download the AdventureWorks from here.
  2. Run following script (replace your path of mdf file.
CREATE DATABASE AdventureWorks2008R2
ON (FILENAME = 'C:\SQL 11 CTP1\CTP1\AdventureWorks2008R2_Data.mdf')
FOR ATTACH_REBUILD_LOG ;

When you run above script it will give you following message and you are DONE!

File activation failure. The physical file name “C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008R2_Log.ldf” may be incorrect.
New log file ‘C:\SQL 11 CTP1\CTP1\AdventureWorks2008R2_log.ldf’ was created.
Converting database ‘AdventureWorks2008R2’ from version 679 to the current version 684.
Database ‘AdventureWorks2008R2’ running the upgrade step from version 679 to version 680.
Database ‘AdventureWorks2008R2’ running the upgrade step from version 680 to version 681.
Database ‘AdventureWorks2008R2’ running the upgrade step from version 681 to version 682.
Database ‘AdventureWorks2008R2’ running the upgrade step from version 682 to version 683.
Database ‘AdventureWorks2008R2’ running the upgrade step from version 683 to version 684.

SQL SERVER - Installing AdventureWorks for SQL Server denaliupgrade

Here is the video on the same subject. The video also contains the latest AdventureWorks database.

I will soon write my experience about Denali. However, SQL Server Management Studio more started to look alike Visual Studio.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Backup, SQL Restore, SQL Sample Database, SQL Scripts, SQL Server Management Studio
Previous Post
SQLAuthority News – A Successful Performance Tuning Seminar at Pune – Dec 4-5, 2010
Next Post
SQL SEVER – Finding Memory Pressure – External and Internal

Related Posts

6 Comments. Leave new

  • Hi Pinal,
    Yes Denali SSMS looks more like Visual Studio, which has led to some features not working as expected compared with the SQL Server 2008 SSMS. Look at this blog by aaron_bertrand SQL Server MVP.

    Reply
  • You just forgot to mention the important point here that not to install CTP version to the productive environment. It is not at all recommended by Microsoft. The best option is either to use the Test system or Virtual machine.

    Reply
  • I am still having trouble downloading the database. I followed the instructions exactly and I am getting the following error

    CREATE DATABASE AdventureWorks2008R2
    ON (FILENAME = ‘C:\Users\brevelant\Desktop\SQL Statements\AdventureWorks2008R2_Data’)
    FOR ATTACH_REBUILD_LOG ;

    Msg 5133, Level 16, State 1, Line 1
    Directory lookup for the file “C:\Users\brevelant\Desktop\SQL Statements\AdventureWorks2008R2_Data” failed with the operating system error 5(Access is denied.).

    Reply
  • getting an error:

    Cannot use file ‘E:\MSSQL\Data\AdventureWorks2008R2_Data.mdf’ for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it.

    Please help.

    Reply
  • Getting same error as Brayan…
    Msg 5133, Level 16, State 1, Line 1
    Directory lookup for the file “C:\Users\……..\AdventureWorks2008R2_Data” failed with the operating system error 5(Access is denied.).

    Reply
  • HI I tried, and got the following message:

    File activation failure. The physical file name “C:\CodePlex Database\AdventureWorks2012_log.ldf” may be incorrect.
    The log cannot be rebuilt when the primary file is read-only.

    Reply

Leave a Reply