Yesterday I went through the process of replacing an old, failing hard drive, out of my Windows 10 Pro machine. I replaced it with an SSD. It gives my old desktop another couple years of use, I hope. 🙂
I had SQL Server Developer Edition on a second hard drive. Naturally the .MDF and .LDF files are still in my D:\Databases folder. I've downloaded SQL Server 2019 Developer Edition and SSMS 18.5. I just tried to attach the .MDF, but that didn't work. Here's the error:
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'D:\Databases\JobSearch.MDF'. (Microsoft SQL Server, Error: 5123)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=15.00.2000&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476
I've gone to the link but, well, it wasn't much help. So, how do I resolve this?