When you try to attach a SQl Server database (MDF file), you might face this “Access is denied” error. One of the example is the AdventureWorks sample database.
To bypass this error, all you need to do is to launch the SQL Server Management Studio in Administrator mode. The steps:-
- Locate the SQL Server Management Studio shortcut.
- Right click on the shortcut and select “Run as administrator”.
- You should be able to attach the database now!