2014-10-28 93 views
0

我有一系列在訂閱服務器上創建的行未被複制到發佈服務器。衝突查看器顯示的5(Upload insert failed)的這個錯誤衝突類型:解決上傳插入失敗的合併衝突

A row insert at '{subscriber}' could not be propagated to '{Publisher}'. This failure can be caused by a constraint violation. The merge process was unable to synchronize the row.

如果我點擊「提交失敗者」來解決它,我得到這個錯誤:

The insert failed. It conflicted with an identity range check constraint in database '{Database}', replicated table '{Table}', column '{Column}'. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent. The statement has been terminated. (Microsoft SQL Server, Error: 548)

我已經運行sp_adjustpublisheridentityrange任何新創建的行正在成功複製,但這些行仍然不會複製。保留在訂戶上創建的行ID是很重要的,所以我不能刪除並重新插入行。我該如何解決這些衝突?

+0

這將很難告訴事後造成這種情況的原因。對於其中一個衝突,請嘗試暫時禁用身份範圍檢查約束,然後嘗試提交失敗者。 – 2014-10-29 16:28:33

回答

0

此問題實際上不是由表A的標識列引起的,而是外鍵列。表B中的行表A中的行FK'd沒有複製。我不知道爲什麼這些行沒有複製。

我觸發了複製,通過更新表B的每一行中的值,導致複製以查看更改並複製這些值。在複製完成後,表A中的每一行都會正確複製,並且所有內容都會再次同步。