One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files.

 

ERROR MESAGGE:

“One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.”

EXPLANATION:

If the Data files and Transaction Log files belong to different backups or if they belong to different databases, an error message can be received.

For example, imagine you have a database named “x”. Consider that the backup is taken directly as * .mdf \ ndf and * .ldf.

If you combine data files from 30.09.2009 and Transaction Log files dated 01.10.2009, you will see this error message if you try to attach the database in this way.

SOLUTION:

You must match the correct Data and Transaction Log files and attach them.

Ekrem Önsoy
Author: Ekrem Önsoy

The original article was written in Turkish by Ekrem Önsoy and translated to English by dbtut with the consent of the author. The copyright of the article belongs to the author. The author shall not be liable in any way for any defect caused by translation.

Leave a Reply

Your email address will not be published. Required fields are marked *