aherlambang
aherlambang

Reputation: 14418

can't attach .mdf into sql server management

Why can't I browse deeper into the folder, I still have some folders there: alt text http://img168.imageshack.us/img168/3056/mdf.jpg

Upvotes: 6

Views: 5947

Answers (3)

reversebind
reversebind

Reputation: 1316

I had a mdf file on my desktop but couldn't access it either due to not being able to browse deeper.

I solved it by going to

start > all programs > Microsoft SQL Server 2008 R2 > Sql Server Configuration Manager

within the Sql configuration manager I went to SQL Server Services and double clicked on the instance running > Log On > change built-in account to 'Local System'. Mine was set to network services but as soon as a changed it to local system I could access my desktop and all my user files.

Upvotes: 6

Adam Robinson
Adam Robinson

Reputation: 185643

Your SQL Server service account likely does not have access to the folder you're attempting to browse. The ideal solution (from a security perspective) would be to move the file to another, non user-specific location. However, what you're trying to do can be done.

  1. Determine the SQL Server instance service account. To do this, view your computer's services and locate "SQL Server" or "SQL Server (instancename)". Double-click and select the "Log On" tab to determine the account being used.
  2. Starting with the user's folder, alter the security to grant read and browse permission to the user located in step 1. You'll need to do this for each folder in the path, starting with the the user (in other words, if it's in C:\Documents and Settings\user\Desktop, you'll have to do this on user and Desktop).
  3. Locate the specific file you wish to attach and grant read and write privileges to the same account.

To alter the permissions on a folder or file, right-click and select "Properties", then the "Security" tab. You can add additional permissions by clicking "Add..." and locating the user that you want to explicitly grant (allow) or deny permissions to.

Upvotes: 13

JYelton
JYelton

Reputation: 36512

The subfolders in users are often password-protected and can only be accessed by the owner of the user folder. If the folder you are trying to access is your own, then you may have a permissions problem and need to modify the folder settings in your OS.

Try navigating to the folder outside of SQL Manager, in Windows Explorer. If you still can't access the folder you may need to try logging on an administrator-level user and modify the folder permissions.

Upvotes: 1

Related Questions