locked
Attaching a database RRS feed

  • Question

  • When trying to attach a database to SQL Server 2008 Express, I am unable to get to my Documents folder in the Add dialog box. I go to Users\owner and there are no subfolders. I have to move the database to another folder to be able to attach it. I can put it in the Default users Documents and get in but not in mine.
    Wednesday, November 14, 2012 4:52 PM

Answers

  • I watched a training video and the instructor was able to attach a database that was in his user profile documents folder. I've come to the conclusion that because I auto login to Windows that may be the reason that I don't see anything in my user profile. I have since moved any database I want to attach to the SQL DATA folder before attaching.

    Thanks for the suggestions all

    • Marked as answer by nptimb Friday, November 16, 2012 4:46 PM
    Friday, November 16, 2012 4:46 PM

All replies

  • When attaching databases, not all folders are visible. SSMS doesn't list all folders, because it is not a file explorer application.

    You have two options:

    1. Move the database to another folder.
    2. Attach the database using T-SQL.

    EXEC sp_attach_db @dbname = N'AdventureWorks2012', 
        @filename1 = 
    N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data\AdventureWorks2012_Data.mdf', 
        @filename2 = 
    N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data\AdventureWorks2012_log.ldf';
    • Edited by irusul Wednesday, November 14, 2012 6:37 PM
    Wednesday, November 14, 2012 6:33 PM
  • I am unable to get to my Documents folder in the Add dialog box.

    Hello,

    You are the only one who can access your profile folder, no one else, also not the SQL Server service account and that one is the account that accesses the database file; therefore you can't see the folder in the add dialog.

    Move the database files to a folder where the account do have read/write permissions; at it's best to the DATA subfolder of your SQL Server installation.


    Olaf Helper

    Blog Xing

    • Proposed as answer by Allen Li - MSFT Thursday, November 15, 2012 6:38 AM
    Wednesday, November 14, 2012 6:39 PM
  • I watched a training video and the instructor was able to attach a database that was in his user profile documents folder. I've come to the conclusion that because I auto login to Windows that may be the reason that I don't see anything in my user profile. I have since moved any database I want to attach to the SQL DATA folder before attaching.

    Thanks for the suggestions all

    • Marked as answer by nptimb Friday, November 16, 2012 4:46 PM
    Friday, November 16, 2012 4:46 PM