使用合并复制还原 Sql Server 2008 数据库时出错
我试图从文件恢复数据库并收到以下错误:
“索引上不允许显式 DROP INDEX...” “它用于执行主键约束。”
如果我删除主键并创建新的备份,它可以正常恢复。
主键的独特之处: --它位于默认的 GUID NEWSEQUENCIALID() 上 --用于合并复制
一些具有相同主键结构的表恢复得很好。但是有2个表在我设置主键时导致了上述错误。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是 4 个月前的答案,但有人可能会发现它有用。
我在使用合并复制恢复数据库的 .bak 文件时遇到了同样的问题,您需要转到选项并选中“WITH KEEP_REPLICATION”选项,然后照常恢复数据库。恢复过程将会成功。
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.