Errors restoring a Sql Server 2008 database with Merge Replication

535 Views Asked by At

I'm trying to restore my database from a file and get the following error:

"An explicit DROP INDEX is not allowed on index..." "It is being used for PRIMARY KEY constraint enforcement."

If I delete the primary key and create a new backup it restores fine.

Unique things about the primary key: --It is on a GUID with default NEWSEQUENCIALID() --It is used for merge replication

Some tables with identical primary key structures are restored just fine. But there are 2 tables that result in the above error when I set the primary key.

1

There are 1 best solutions below

0
On

I know this is a 4 months old anwer but somebody might find it useful. I had the same issue restoring a .bak file of a database with merge replication, you need to go to options and check the "WITH KEEP_REPLICATION" option, then restore your database as usual. The restore process shall success.