Recovering the Database from an .MDF File
From SQLServerPedia
|
See Also: Main_Page - Database Administration - Backup & Recovery Recovering the Database from an .MDF FileIn rare instances you might experience a situation where you don't have a valid SQL Server backup, but do have a .MDF file saved by Windows backup. The good news is that if the .MDF file is not damaged, you might be able to recover the database from it.Suppose you've lost the pubs database and you have no backups, but you do have pubs.mdf which is safe and sound, saved to the backup directory. Here is how you should go about recovering your database:
At this point SQL Server will create a new log file for your pubs database, recover it and make it operational. Although this method of recovering a database works, it is strongly recommended that you keep valid backups at all times and restore databases from backup files when needed. |