Answered Where do I get a AdventureWorks mdf & ldf?

  • Friday, February 10, 2012 12:34 AM
     
     

    Hi,

    I went to http://msftdbprodsamples.codeplex.com/releases/view/55926, and downloaded the AdventureWorks2008R2_SR1.exe, but the databaseinstaller.exe constantly crashes without any error message. It is a Windows 7 home premium 64 bit. I have a SQL Server 2008 R2 Developer installed and running OK. I have tried to restart the PC.

    To work around it, where can I download a mdf and ldf file and direct attach it?

    Thanks!



    • Edited by silly_dude Friday, February 10, 2012 12:35 AM
    •  

All Replies

  • Friday, February 10, 2012 1:14 AM
     
     

    Hi,

    Take a look here: http://sqlserversamples.codeplex.com/

    []'s


    Erickson Ricci
    Microsoft MCITP 2008 Admin, MCTS SQL Server 2005, 2008
    Visite o meu blog: http://ericksonricci.wordpress.com
    Me siga no twitter: @EricksonRicci
    LinkedIN: http://br.linkedin.com/in/ericksonricci
    e-mail: ericksonfabricio@gmail.com
    **Ajude a melhorar o sistema de busca do fórum.Marque a(s) resposta(s) que foram úteis**
    **Se esta resposta solucionou a questão, então, por favor, marque-a como resposta.**

  • Friday, February 10, 2012 1:26 AM
     
     

    Hi Erickson,

    The link that I posted in the original post, was from this site. I downloaded the database installer, but it crashes all the time. That's why I was asking: "where do I get a MDF and LDF and attach it?"


  • Friday, February 10, 2012 2:20 AM
     
     

    Also tried following link

    file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Samples/Integration%20Services/Package%20Samples/DataCleaning%20Sample/Readme_DataCleaningSample.htm

    and downloaded the AdventureWorks2008R2_Data.mdf. But when I tried to attach it, I got this error message:

    The header for file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008R2_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.

    In conclusion - nothing works.

  • Friday, February 17, 2012 6:21 AM
    Moderator
     
     Answered
    Can you please look in the Application Log on your computer for entries made by the installer.  This should provide details of what's gone wrong.

    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

    • Marked As Answer by silly_dude Friday, February 17, 2012 6:54 AM
    •  
  • Friday, February 17, 2012 6:25 AM
    Moderator
     
     Answered

    Also tried following link

    file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Samples/Integration%20Services/Package%20Samples/DataCleaning%20Sample/Readme_DataCleaningSample.htm

    and downloaded the AdventureWorks2008R2_Data.mdf. But when I tried to attach it, I got this error message:

    The header for file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008R2_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect.

    In conclusion - nothing works.


    Please have a read of the following http://msftdbprodsamples.codeplex.com/releases/view/59211

    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

    • Marked As Answer by silly_dude Friday, February 17, 2012 6:54 AM
    •  
  • Monday, February 20, 2012 4:17 AM
     
     

    Hi,

    When I ran the DatabaseInstaller.exe, it threw following exception:

        The type initializer for 'System.Windows.Media.FontFamily' threw an exception

    Where can I download the mdf data file for AdventureWorksDW2008? I have got AdventureWorks2008R2 but I need the data warehouse version.

    Thanks.


    • Edited by silly_dude Monday, February 20, 2012 4:18 AM
    •  
  • Monday, February 20, 2012 4:25 AM
    Moderator
     
     

    Hi,

    When I ran the DatabaseInstaller.exe, it threw following exception:

        The type initializer for 'System.Windows.Media.FontFamily' threw an exception

    Where can I download the mdf data file for AdventureWorksDW2008? I have got AdventureWorks2008R2 but I need the data warehouse version.

    Thanks.


    As far as I know you can't download those files anywhere.

    I visited the links and can't find any file called DatabaseInstaller.exe.  All I see is AdventureWorks2008R2_SR1.exe  Have you tried running AdventureWorks2008R2_SR1.exe  as an Administrator i.e. right click on the file and select Run as Administrator?


    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

  • Monday, February 20, 2012 4:29 AM
     
     

    I did everything I could think of including running as admin. I first tried to run what your suggested, AdventureWorks2008R2_SR1.exe, it crashed, so I extracted it, and found DatabaseInstaller.exe, and it still crashes, throwing the exception I posted.

    Are you sure we can't download the MDF file for the data warehousing version? I can download the MDF for the normal version.

  • Monday, February 20, 2012 4:39 AM
    Moderator
     
     

    I haven't seen them anywhere.

    There's a discussion here regarding the same error message: http://connect.microsoft.com/VisualStudio/feedback/details/522003/precreatedefaultfamilycollection-fails-on-application-startup

    Could you please check the type of the "windir" registry key under
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
    and make sure its REG_EXPAND_SZ.


    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

  • Monday, February 20, 2012 4:51 AM
     
     

    Thanks I had a look and unfortunately this is not the cause - the windir entry is of type REG_EXPAND_SZ.

    Could you somehow just post the MDF somewhere? I am following a walk through regarding SSIS and it is based on the data warehouse version of AdventureWorks. I need to go to client site tomorrow.

  • Monday, February 20, 2012 5:33 AM
    Moderator
     
     Proposed

    Sorry, but I cannot post the database somewhere as that would be in breach of Microsoft policy.

    I was able to get the database to install by following the manual installation instructions here http://msftdbprodsamples.codeplex.com/wikipage?title=Database%20Installer%20Help%20for%20SQL%20Server%202008R2&referringTitle=Installing%20SQL%20Server%202008R2%20Databases

    Just remember that SqlSamplesDatabasePath is where you want the database created and SqlSamplesSourceDataPath is where the CSV files for the database are located i.e.

    I extracted the contents of AdventureWorks2008R2_SR1.exe to D:\Temp\AdventureWorks2008R2_SR1 therefore SqlSamplesSourceDataPath would be

    :setvar SqlSamplesSourceDataPath "D:\Temp\AdventureWorks2008R2_SR1\"

    SqlSamplesDatabasePath can be any location but I used

    :setvar SqlSamplesDatabasePath   "C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Data\"


    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

    • Proposed As Answer by tooleyrose Tuesday, February 28, 2012 1:45 AM
    •  
  • Tuesday, February 21, 2012 5:24 AM
    Moderator
     
     Answered

    Sorry, but I cannot post the database somewhere as that would be in breach of Microsoft policy.

    I was able to get the database to install by following the manual installation instructions here http://msftdbprodsamples.codeplex.com/wikipage?title=Database%20Installer%20Help%20for%20SQL%20Server%202008R2&referringTitle=Installing%20SQL%20Server%202008R2%20Databases

    Just remember that SqlSamplesDatabasePath is where you want the database created and SqlSamplesSourceDataPath is where the CSV files for the database are located i.e.

    I extracted the contents of AdventureWorks2008R2_SR1.exe to D:\Temp\AdventureWorks2008R2_SR1 therefore SqlSamplesSourceDataPath would be

    :setvar SqlSamplesSourceDataPath "D:\Temp\AdventureWorks2008R2_SR1\"

    SqlSamplesDatabasePath can be any location but I used

    :setvar SqlSamplesDatabasePath   "C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Data\"


    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker


    How did you go with this?

    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    • Marked As Answer by silly_dude Tuesday, February 28, 2012 11:09 AM
    •  
  • Tuesday, April 03, 2012 10:27 PM
    Moderator
     
     Answered

    We uploaded an AdventureWorks 2008 R2 OLTP database and script to CodePlex (http://msftdbprodsamples.codeplex.com/releases/view/59211). Or http://msftdbprodsamples.codeplex.com and click on the SQL Server 2008 R2 OLTP tile.

    Hopefully, this version is easier to attach and use.

    As long as you copy the database to C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\DATA, you should be able to attach the AdventureWorks2008R2_Data.mdf database. You will need to remove the transaction log reference.

    Or you can run the setup script. Follow these steps to install the sample database from the script:

    1. Download AdventureWorks 2008 R2 OLTP Script.zip (http://msftdbprodsamples.codeplex.com/releases/view/59211)
    2. Copy the DDL script files to any path such {SQL Server Path}\Tools\Samples\AdventureWorks 2008 OLTP Script.

      Note The default SQL Server 2008 R2 path is C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\.
    3. Open {SQL Server Path}\Tools\Samples\AdventureWorks 2008 OLTP\instawdb.sql in SQL Server Management Studio.
    4. Update the script path variables.
    5. If necessary, change the :setvar SqlSamplesDatabasePath variable to your SQL Server 2008 R2 path. The default path is C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA.
    6. Change the :setvar SqlSamplesSourceDataPath variable to the path containing the .csv files.
    7. Uncomment each :setvar variable.
    8. On the Querymenu, click SQLCMD Mode.
    9. On the Standardtoolbar, click the Executebutton to run the script.

  • Tuesday, April 03, 2012 10:41 PM
    Moderator
     
     Answered
    • Marked As Answer by silly_dude Wednesday, April 04, 2012 12:25 AM
    •  
  • Wednesday, August 15, 2012 5:57 AM
     
     

    Attaching a database (without a log file - .LDF)

    Read more: http://sqlsolace.blogspot.com/2012/06/attaching-database-without-log-file-ldf.html#ixzz23akBDIio

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

  • Wednesday, August 29, 2012 9:46 PM
    Moderator
     
     Answered

    Hello,

    I uploaded AdventureWorks databases for 2012, 2008R2 and 2008. Each download zip file contains an mdf database file and ldf log file. This consolidates AdventureWorks databases for several SQL Server versions to one page. Please let me know what you think.

    AdventureWorks Databases – 2012, 2008R2 and 2008

    http://msftdbprodsamples.codeplex.com/releases/view/93587