3

As the title suggests, where does SQL Server store the paths to the MDF files it will load at start up.

Our SQL Server is trying to load a file that is not there, reporting errors in the log, but failing to show the database in the treeview of Management Studio. So what I want to do is edit the table(?) that tells it to try and load this file at start-up, thus not creating the database. This will allow me to recreate the DB.

2
  • What version SQL Server?
    – joeqwerty
    Dec 8, 2009 at 12:09
  • It's SQL Server 2005 with the latest SPs. Dec 8, 2009 at 12:11

2 Answers 2

2

MSSQL 2005 stores the MDF locations within the system database "Master"

use master
select name,physical_name from sys.master_files
go

http://support.microsoft.com/kb/224071

0

SQL Server stores the settings you're looking for, in the SQL Server Configuration Manager. Check out the Startup Parameters on the Advanced tab for MSSQLSERVER.

Incidentally, if you are talking about a non-system DB, then you should be able to get SQL Server up and running, and then use the Management Studio to detach DBs that aren't loading up, then reattach them manually.

1
  • (It's also stored in the registry, but I specifically didn't mention this in my answer because editing the registry can end badly.)
    – user3914
    Dec 8, 2009 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.