Thursday, February 20, 2014

Attach Database “Operating System Error 5 (Access is denied)” MSSQL Server 2012.

When I try to attach mdf file I got following error below.

Solution:
There are multiple solutions to this

1    1.    Move .mdf and .ldf to SQLServer install directory \Data\ folder (eg C:\Program Files (x86)\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA) and then attach.
2    2. Give SQL SERVER SERVICE account full access to folder where mdf and ldf files are located.
3       3. Run as Administrator as in Below screens.
Run SSMS as admin as shown in screen below


2 comments: