Click here to Skip to main content
15,895,283 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
SQL have ceased to recognize the MDF file today.
Perhaps due to some system failure it damaged. How can I restore the MDF file that is not recognized as the primary file?

What I have tried:

No action was taken that not to break the file and not to screw things up.)
Posted
Updated 25-Aug-16 1:30am

Quote:
Perhaps due to some system failure it damaged. How can I restore the MDF file that is not recognized as the primary file?
Use last backup and restore the database.
If you don't have backups, you probably have lost everything.
 
Share this answer
 
If your MDF file was corrupt or in unrecognizable format then you have to use some third party tools to sql mdf repair it out for example like MDF Repair Kit or some others. You can search in Google. http://www.mdf.repair/

But you can try to restore the file by yourself if it is not badly damaged.
Data from corrupt mdf file can be recovered by following method:

Repair MDF file with DBCC CHECKDB:
Microsoft offers a command that is known as DBCC CHECKDB, when you run this then it try to detect & fix all the possible error message. If it fails to fix error message then it suggest repair clause.
Re-run the command with suggest repair clause. Your problem might be solved. But, you may loss some amount of data after this.
 
Share this answer
 
Oh, it's sad, because my backup is quite old. but thanks anyway for the answer!)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900