I'm learning how to create an application in Visual Studio and following a tutorial to create a service-based database. When I try to add the new item (service-based db) in Visual Studio, I got the following error:
After doing some research, I found that the "SQL Server (SQLEXPRESS)" service is stopped. I suppose that if I start the service, everything would be ok but I received this error instead:
Following the suggestion in the second error message, I look for the info in Event Viewer and I found a few error messages associated with the failed service start:
FCB::Open failed: Could not open file e:\sql10_main_t\sql\mkmastr\databases\objfre\i386\MSDBData.mdf for file number 1. OS error: 3(failed to retrieve text for this error. Reason: 15105).
FCB::Open failed: Could not open file e:\sql10_main_t\sql\mkmastr\databases\objfre\i386\model.mdf for file number 1. OS error: 3(failed to retrieve text for this error. Reason: 15100).
FileMgr::StartLogFiles: Operating system error 2(failed to retrieve text for this error. Reason: 15105) occurred while creating or opening file 'e:\sql10_main_t\sql\mkmastr\databases\objfre\i386\modellog.ldf'. Diagnose and correct the operating system error, and retry the operation.
At this point, I don't know what to do because the directory e:\sql10_main_t\sql....
doesn't exist! My E:\ drive is labelled as System Reserved
and I have un-tick the Hide protected operating system file (Recommended)
in File Explorer options to show all the hidden folders inside to confirm that this directory doesn't exist.
I can re-install the SQL Server but I want to know how do I fix this issue without re-installing? Or maybe there are something that I'm missing?