Msg 5120, Level 16, State 101, Line 13 Unable to open the physical file_Operating system error 5: "5(Access is denied.)

I got the below error while i am trying attach .mdf file of AdventureWorks database. I am the member of sysadmin group. And the path in which i placed .mdf file is also correct. But when i try to attach the database i am getting this below error.


First i thought this was permission issue, later i realized i have not opened SQL Server management studio "Run as Administrator mode". Once i did that, now i am able to restore the database successfully.

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server