Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

SQL Server Management Studio - Unable to attach to an MDF file in my user profile.

I downloaded an MVC template onto my development machine a dropped it into the projects folder in my user profile (C:\Users\jdana\projects\gld_ember_mvcspa). An MDF and LDF file came along for the ride with the template. They're located here: C:\Users\jdana\projects\gld_ember_mvcspa\App_Data. For the life of me, I can't get SQL Server Management Studio to read from or attach to any MDF file in my user profile. (I'm running MSSQL 2014 Standard on a Windows 7 box.) Here's what I've tried thus far.

The following http://stackoverflow.com/questions/2330439/access-is-denied-when-attaching-a-database looked like a dead-match to my issue. I've given my local login account explicit full permissions to the projects folder and all child folders (making sure to logout/login afterwards).
I gave my local login account ownership of the projects folder and all child folders (making sure to logout/login afterwards).  
I checked login associated with the MSSSQLSERVER Windows Service, it's NT Service\MSSQLSERVER. I gave this login full permissions to the project folder (making sure to logout/login afterwards).

Finally, I launched SQL Server Management Studio with a right-click Run As Administrator.

None of this worked. My user profile folder remains inaccessible to SQL Server Management Studio.
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What's the error message?
Avatar of jdana

ASKER

I'm perplexed. I now have access to my user profile in MSSQL Management Studio. One of the above-mentioned tasks got the job done. While I had logged out/in multiple times, I hadn't rebooted. That makes me think it was the permissions associated with NT Service\MSSQLSERVER that made the difference.

Kyle - I'm inclined to take your advice anyway. Given the fact that MSSQL doesn't "like" data living in user profile directories.

Thanks!

J