Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

up vote 1 down vote accepted

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

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

 
discard

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.