Restoring a SQL database with an .mdf file
How can I restore a SQL database with an .mdf file?

Software/Hardware used:
ASKED: November 7, 2008  3:32 PM
UPDATED: May 5, 2012  3:13 PM

Answer Wiki:
You can't restore from an MDF. You can however attach the MDF back to your SQL Server instance using the sp_attach_db_single_file system stored procedure. Check Books OnLine for the full syntax.
Last Wiki Answer Submitted:  November 7, 2008  7:33 pm  by  Denny Cherry   64,505 pts.
All Answer Wiki Contributors:  Denny Cherry   64,505 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

you can do it by stopping SQL service from SERVICES AND APPLICATIONS.
first create the database with same name, than after stopping sql service, just simply copy paste the MDF and LDF files from your backup.

 10 pts.

 

This won’t always work, as the sizes will be different from the sizes of the files that are listed in the master database. Not to mention why would you stop the instance to do something which you don’t have to take an outage to complete?

 64,505 pts.

 

You may restore sql database thanks to following software

sql server fix

tool will save all sql tables, stores and so on inside new .sql file

 10 pts.