While accessing to an .mdf file, I receive this: MyFileName.mdf is not a primary database file. Does it mean the file is corrupted?
Please help in repairing this file. I heard about some manual tricks to fix SQL database corruption, but I’m not aware of it.
Please share it.
When you try to attach a MDF database to SQL Server and get the error “xxx.mdf is not a primary database file”, then for most of the cases, that means your MDF file is corrupt or damaged.
There are two possible solutions based on the situation:
If the corruption is not severe, then you can use the SQL Server build-in command DBCC CheckDB to correct the errors. See http://technet.microsoft.com/en-us/library/ms176064.aspx . I guess that is what you mean “manual tricks”.
If the corruption is severe, then you may try some third party tools to scan and recover the data from your corrupted MDF and NDF database files. Below is a list of SQL recovery tools:
The list seems to rather comprehensive that including nearly all the popular tools in the market.
Hope this will help. Good luck!
As the OP hasn’t returned that must have solved the problem