简体   繁体   English

使用合并复制还原Sql Server 2008数据库时出错

[英]Errors restoring a Sql Server 2008 database with Merge Replication

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." “索引上不允许使用显式DROP INDEX ......”“它用于PRIMARY KEY约束实施。”

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 关于主键的独特之处: - 它位于具有默认NEWSEQUENCIALID()的GUID上 - 它用于合并复制

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. 但是当我设置主键时,有2个表导致上述错误。

I know this is a 4 months old anwer but somebody might find it useful. 我知道这是一个4个月大的人,但有人可能会发现它很有用。 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. 我有同样的问题使用合并复制恢复数据库的.bak文件,您需要转到选项并检查“WITH KEEP_REPLICATION”选项,然后照常恢复数据库。 The restore process shall success. 恢复过程应该成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM