locked
Problem attaching Adventure Works Sample Database RRS feed

  • Question

  • I'm attempting to attache the sample database, Adventure Works, using SQL Server Management Studio.  I've downloaded the file and am attempting to attach the database but receive error messages when trying to attach the database.  I've scoured everything I can find on this forum and have had no luck.  

    My user account has full access and I'm adminstrator on this machine. 

    Actions:  

    1. In SQL Server Management Studio, I right click on 'Databases' and choose 'attach'

    2. Under 'MDF File Location' I click on 'Add'.  A navigation box appears. 

    3. I attempt to navigate to 'C:\Microsoft Press\Analysis Services 2008 SBS\Setup\SSAS2008SBS.mdf'

    I can get to 'C:\Microsoft Press\Analysis Services 2008 SBS' but no directories appear under that directory.

    When I check the permissions, the file it is NOT read-only.  But the check box for 'Read Only(applies only to files in directory)' is blue but not checked.  I cannot remove the blue box.  What does this mean?

    4. Failing that, attempted to execute the following T-SQL query:

    USE master;

    GO

    CREATE DATABASE SSAS2008SBS

          ON (FILENAME = 'C:\Microsoft Press\Analysis Services 2008 SBS\Setup\') 

          FOR ATTACH ;

    GO

    And get this error ...

    Msg 5133, Level 16, State 1, Line 1

    Directory lookup for the file "C:\Microsoft Press\Analysis Services 2008 SBS\Setup\SSAS2008SBS.mdf" failed with the operating system error 5(Access is denied.).

    It seems to me that it's an account/permissions error.  If I've installed SQL Server with an incorrect account, how can I change it?  I installed the components as 'NT AUTHORITY/NETWORK SERVICE.'  

    Environment:

    SQL Server Management Studio version = 10.50.1600.1

    Operating system = Windows 7

    Tuesday, January 17, 2012 10:58 PM

Answers

  • Hi,

    I face problem like this yesterday and solved by the following steps.

     

    Go to your file C:\Microsoft Press\Analysis Services 2008 SBS\Setup\SSAS2008SBS.mdf

    Right click on the file and choose security.

    In security tab add your service account and give him full permission on the file, if it didn't work try to get the current user the full permission.

    Attach your database

     

    I hope this is helpful.

     

    Elmozamil Elamir

    MyBlog


    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    http://elmozamil.blogspot.com
    • Marked as answer by Duckettb Wednesday, January 18, 2012 3:14 PM
    Wednesday, January 18, 2012 5:48 AM
  • Hi,

    Have you applied permissions and made certain that the 'NT AUTHORITY/NETWORK SERVICE' account has modify permissions on 'C:\Microsoft Press and all the sub-folders and files?


    Sean Massey | Consultant, iUNITE

    Feel free to contact me through My Blog or Twitter.
    Please click the Mark as Answer button if a post solves your problem!

    • Marked as answer by Duckettb Wednesday, January 18, 2012 3:14 PM
    Tuesday, January 17, 2012 11:31 PM

All replies

  • Hi,

    Have you applied permissions and made certain that the 'NT AUTHORITY/NETWORK SERVICE' account has modify permissions on 'C:\Microsoft Press and all the sub-folders and files?


    Sean Massey | Consultant, iUNITE

    Feel free to contact me through My Blog or Twitter.
    Please click the Mark as Answer button if a post solves your problem!

    • Marked as answer by Duckettb Wednesday, January 18, 2012 3:14 PM
    Tuesday, January 17, 2012 11:31 PM
  • Hi,

    I face problem like this yesterday and solved by the following steps.

     

    Go to your file C:\Microsoft Press\Analysis Services 2008 SBS\Setup\SSAS2008SBS.mdf

    Right click on the file and choose security.

    In security tab add your service account and give him full permission on the file, if it didn't work try to get the current user the full permission.

    Attach your database

     

    I hope this is helpful.

     

    Elmozamil Elamir

    MyBlog


    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    http://elmozamil.blogspot.com
    • Marked as answer by Duckettb Wednesday, January 18, 2012 3:14 PM
    Wednesday, January 18, 2012 5:48 AM
  • >>>It seems to me that it's an account/permissions error.  If I've installed SQL Server with an incorrect account, how can I change it?  I installed >>>the components as 'NT AUTHORITY/NETWORK SERVICE.'  

    In configuration Manager  you can replace this account with more powerful , it will prompt to restart the service


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Wednesday, January 18, 2012 9:43 AM
    Answerer
  • Thanks to both Elmozamil and Sean.  The problem was not with the file but with the intermediate directories.  Once the account had all permissions, I could find the file.  
    Wednesday, January 18, 2012 3:16 PM