Unable to open the physical file XXX.mdf

attach

附加一个新的数据库,报如下异常:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "E:\资料库\DB Document\My DB\TestDB.mdf". Operating system error 5: "5(拒绝访问。)". (Microsoft SQL Server, Error: 5120)

解决方案是用administrator权限打开SQLServer Management

runas

 
原文地址:https://www.cnblogs.com/end/p/1993625.html