2

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:

enter image description here

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:

enter image description here

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?

2
  • Is it possible that your drivers changed letter and there used to be a different driver with the letter E: assigned to it? What's the SQL Server version?
    – Ronaldo
    Oct 29, 2019 at 12:18
  • @Ronaldo , its SQL server 2008. I don't remember changing the drive letter of System Reserved and I don't remember installing the SQL server individually, I assume that it was installed together with the Visual Studio.. which I only install a couple of months ago. I'm looking in other drives whether this directory exists but so far I haven't found it..
    – FanoFN
    Oct 29, 2019 at 23:59

1 Answer 1

1

Please, try to rebuild the system databases running the following on a CMD prompt:

  1. Change directories to the location of the setup.exe file. The default location on your computer should be something like C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008.
  2. Run Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=SQLEXPRESS /SQLSYSADMINACCOUNTS=YourAccountsHere /SAPWD=YourSaLoginPassword

Check the Rebuild System Databases documentation to understand the options.

Also you might check these social msdn and sqlservercentral posts related to your problem. It won't reinstall SQL Server, instead it will recreate the system databases with the broken references to the nonexistent path shown on the error message.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .