5 pts.
 How to restore MDF file as backup database
My database saves as MDF. I want to know what are the steps to restore or create a new database using a MDF file? I tired to restore as usual but it shows an error. Please help.

Software/Hardware used:
ASKED: April 23, 2008  10:15 AM
UPDATED: April 18, 2013  8:08 PM

Answer Wiki:
An MDF file isn't a backup file isn't the main data file (or master data file depending on who you ask) hence the file extension MDF. You can attach the MDF to the database by right clicking on the databases folder in Enterprise Manager (SQL 2000) or Management Studio (SQL 2005) then selecting all tasks and then Attach Database. When you do this you will get an error about the log file missing. This shouldn't matter as SQL Server will simply create a new log file for you. This will only work if the SQL Server was stopped when you copied the MDF file from the old SQL Server. If you copied the file while the SQL Server was running this file probably will not attach either and you will need to get a valid backup of the database. You can read up more on SQL Server backup's here. (PDF download). The above mentioned one is perfect. It worked pretty cool. Thanks for the information.
Last Wiki Answer Submitted:  April 18, 2013  8:08 pm  by  Michael Tidmarsh   11,400 pts.
All Answer Wiki Contributors:  Michael Tidmarsh   11,400 pts. , Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 64,520 pts.