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


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.

  • 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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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