Posts

Unable to open the physical file "xyz.mdf". Operating system error 5: "5(Access is denied.)".

Image
I downloaded some project from  here , this included some test MS SQL Server database file called 'SchoolDB.mdf'. I tried to attach it in SQL Server Management Studio 2017. SSMS throws error as - Attach database failed for Server 'VSPLBLRLT0231'.  (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=14.0.17285.0+((SSMS_Rel_17_4).180821-0238)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476 ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) Unable to open the physical file "D:\xyz@ xyz \LearnPlace\entityframeworktutorial.net\EF6-DBFirst-Demo-master\EF6-DBFirst-Demo-master\EF6DBFirstDemo\SchoolDB.mdf". Operating system error 5: "5(Access is denied.)". CREATE DATABASE failed. Some file names listed could not be creat...

This database file is not compatible with the current instance of SQL Server.

Image
I downloaded some project from here , this included some test MS SQL Server database file called 'SchoolDB.mdf'. When I try to open it in Visual Studio 2019, VS throws error as - This database file is not compatible with the current instance of SQL Server. To resolve this issue, you must upgrade the database file by creating a new data connection, or you must modify the existing connection to this database file. For more information, see https://go.microsoft.com/fwlink/?LinkId=235986 Found  solution   here