复制 SQL Server
在我的生产服务器中,我有复制,工作正常,我有分布式数据库,作为 2 个订阅者 db 。 我的数据是从生产环境复制的(工作正常),但同时 数据被复制到订阅服务器中的分布式数据库,它会抛出错误
Err msg =
复制-复制分发子系统:PRD01-XYZ-VREPL1\REPL01-25 失败。 违反主键约束“PK_vendors”。 无法在对象“dbo.tabname”中插入重复的键。
In my Production Server i have replication which working fine, i do have Distributed Database which as 2 subscriber db .
My data is replicated from Production envi (working fine) but while
data gets replicated to Distributed database in Subscriber it throws an Error
Err msg =
Replication-Replication Distribution Subsystem: PRD01-XYZ-VREPL1\REPL01-25 failed.
Violation of PRIMARY KEY constraint 'PK_vendors'.
Cannot insert duplicate key in object 'dbo.tabname'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经有一段时间没有这样做了,但这是一个尝试。
首先,我不介意看到不匹配的记录,所以我会尝试这样的事情:
希望对于“some_field”,有另一个唯一的列,或者可能是 dt_entered,或者可能是 rowguid。 :)。
有人有非常相似的问题和一些非常出色的答案
复制中的身份危机
sp_adjustpublisheridentityrange
最后,如果您的情况的逻辑涉及记录如果通过复制以外的方式插入订阅者表,并且复制类型不是合并,那么您很可能会继续遇到这样的问题。
祝你好运。
I haven't done this in a while, but here is a stab.
First, I wouldn't mind seeing the records which aren't matching, so I would try something like this:
Hopefully, for "some_field", there is another unique column, or perhaps a dt_entered, or perhaps a rowguid. :).
someone with a very similar problem and some very excellent answers
The identity crisis in replication
sp_adjustpublisheridentityrange
Finally, if the logic of your situation involves records being inserted into the subscriber table other than by replication, and the type of replication is not merge, you may very well continue to have problems like this.
Good luck.