entityframeworktutorial / EF6-DBFirst-Demo

Entity Framework 6 Database-First Demo Project
MIT License
143 stars 159 forks source link

Error Attaching mdf file #8

Closed warpdriv closed 1 year ago

warpdriv commented 1 year ago

Hi Folks,

Thank you for putting this project together.

I'm on a win11 box with Sql Server 2022. I have copied the SchoolDB.mdf file to my %SqlServerInstallLocation%\DATA folder.

When I go to attach it in SSMS 19, it gave me the below error. I've googled and tried a number of things with no luck.

Can I please get some advice on how to solve this?

Thank you.

Unable to open the physical file "D:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\SchoolDB_log.ldf". Operating system error 2: "2(The system cannot find the file specified.)". CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5120)

warpdriv commented 1 year ago

Sorry, I just searched the closed issues and found the answer about removing the ldf file in the grid.