Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 How to restore .mdf file in sql ?

Author  Topic 

Starting Member

1 Post

Posted - 2015-03-19 : 17:43:42
There was a failure of the system how to restore .mdf file in sql server 2005 how to fix?

Almighty SQL Goddess

38200 Posts

Posted - 2015-03-19 : 17:55:31
You could try attaching the database, however that might not work. Restore from backup is your best bet. Please don't say you don't have ANY backups.

Tara Kizer
SQL Server MVP since 2007
Go to Top of Page

Posting Yak Master

212 Posts

Posted - 2015-04-07 : 05:51:45
Detach the database and move your .mdf file from save location. Create new database with the same name, same files,location and size. Now stop your server. Swap the .mdf file of new database to your old one. Now start the server again.
Go to Top of Page

Master Smack Fu Yak Hacker

2179 Posts

Posted - 2015-04-09 : 01:43:43
What exactly are you able to retrieve from the failed system?have you recovered the system (partial) or are you attempting to restore to a new sql server instance?

Jack Vamvas
Go to Top of Page

Yak Posting Veteran

52 Posts

Posted - 2015-05-27 : 05:18:07
You must run DBCC CHECKDB command and determine the errors the try to run DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS
Go to Top of Page

- Advertisement -