Click here to Skip to main content
15,662,484 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All

I have mdf file of SQL sever 2008 R2 version database, some how my client has not detach the database in right way so i have corrupted mdf file. now i am unable to attach it as it is giving me the error that mdf and log files are not primary

please guide me how to restore the data using the mdf file


1 solution


Check the database you are trying to attach is of the same version or not, in case
if you are using Sql Server 2008 then its not possible directly to attach the copy of R2 database in that case you need to install some utilities which support this R2 database.

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