Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What version SQL Server? – joeqwerty Dec 8 '09 at 12:09
It's SQL Server 2005 with the latest SPs. – Colin Desmond Dec 8 '09 at 12:11
up vote 2 down vote accepted

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

use master
select name,physical_name from sys.master_files

share|improve this answer

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.

share|improve this answer
(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 '09 at 12:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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