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

The Windows os on my server crushed. I do have disk file access. I can get the mdf and ldf files of my sql 2008 database is it possible to restore the database from those files, and how to do it ? Thanks, Dani

share|improve this question
up vote 6 down vote accepted

Yes, as long as the files didn't get corrupted you can do a reattach. In SQL Server Management Studio, right-click on Databases on your new server instances and choose Attach Database. It will ask you the location of your mdf file, and you might also have to browse to your ldf file. Should be no problem. Might take a minute depending on how much in your transaction log has not been committed.

Here's the MSDN article for it.

share|improve this answer
Thanks, I'll try and post the results here :-) looks promising – Dani Oct 4 '09 at 17:34
OK, Everything worked as you said :-) just needed to recreate the users. – Dani Oct 5 '09 at 9:47

Attach Database

If you have the files you can copy them over to the new database server and "Attach Database" via the MS-SQL GUI.

You'll be prompted for the locations of the files and then the system will grind away for a bit and (hopefully if there's no corruption) attach the database.

Good luck!

share|improve this answer

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.