not able to attach database AdventureWorks2008 comes with CD 70-433 sql 2008

Answered not able to attach database AdventureWorks2008 comes with CD 70-433 sql 2008

  • Thursday, March 22, 2012 6:22 AM
     
      Has Code

    Hi,

    I have following version of sql server installed in my Machine.
    Microsoft SQL Server 2008 R2 (RTM) -Enterprise Edition (64-bit)

    I have copied all the files in database folder in following path
    C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER2008\MSSQL\DATA
    and successfully attached the AdventureWorksDW2008 and Northwind database.
    but when i go to attach AdventureWorks2008. It is giving me the error attached in image

    I have enabled File stream.

    I don't know why it is taking following path in error(please see image at the end)

    C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA
    instead of C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER2008\MSSQL\DATA



    • Edited by DK_mishra Thursday, March 22, 2012 6:24 AM
    • Edited by DK_mishra Thursday, March 22, 2012 6:26 AM
    •  

All Replies

  • Thursday, March 22, 2012 8:15 AM
     
     

    Hello,

    As its best you should download & install the AdventureWorks sample database from CodePlex: http://msftdbprodsamples.codeplex.com/releases/view/55926


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

  • Thursday, March 22, 2012 8:17 AM
    Moderator
     
     

    The transaction log for this databse is missing.

    1. Select the line containing  File Type of Log (in the bottom half of the Attach Databases dialog)
    2. Click on the Remove button.
    3. Click on OK

    The log file will get created once the DB is attached.


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

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

  • Friday, March 23, 2012 4:16 PM
     
     
    thanks for your information i have downloaded the file without filestream and attached in database .It works.
  • Friday, March 23, 2012 4:17 PM
     
     
    it is giving the same error after removing the log file because still it is taking wrong path.
  • Monday, March 26, 2012 11:16 PM
    Moderator
     
     

    We are investigating this issue. I’ll reply with status within 3 days.

  • Monday, March 26, 2012 11:50 PM
    Moderator
     
     
    it is giving the same error after removing the log file because still it is taking wrong path.

    Then all you need to do is change the path to where the DB is.

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

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

  • Tuesday, March 27, 2012 11:41 AM
     
     
  • Thursday, March 29, 2012 7:48 PM
    Moderator
     
     

    We are planning to update the AdventureWorks 2008 R2 OLTP database and script on http://msftdbprodsamples.codeplex.com/ within the next few days. I will update this thread with the CodePlex link and install instructions after we publish in a few days. Hopefully this update will help you. Please check back in a few days.


  • Tuesday, April 03, 2012 10:17 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.  As Mr. Wharty writes above, 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.