无法在具有唯一索引的对象'dbo.MSmerge_contents'中插入重复的键行

时间:2012-04-05 05:30:14

标签: sql sql-server-2008 indexing replication merge-replication

我们在1个发布者和12个订阅者之间配置了合并复制,所有订阅者都拥有SQL Server 2008 R2

在其中一个订阅中我收到以下错误

Error messages:
The merge process could not replicate one or more UPDATE statements to the 'Subscriber' because a stored procedure failed to execute. Troubleshoot by using SQL Profiler. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147200989)
Get help: http://help/MSSQL_REPL-2147200989
Cannot insert duplicate key row in object 'dbo.MSmerge_contents' with unique index 'nc2MSmerge_contents'. (Source: MSSQLServer, Error number: 2601)
Get help: http://help/2601

在错误中提到“Cannot insert duplicate key row in object 'dbo.MSmerge_contents' with unique index 'nc2MSmerge_contents'”我检查了nc2MSmerge_contents索引脚本,但没有为索引指定唯一约束

CREATE NONCLUSTERED INDEX [nc2MSmerge_contents] ON [dbo].[MSmerge_contents] 
(
    [generation] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

以下是表格结构

enter image description here

我需要在不删除/重新创建订阅的情况下修复此问题。任何人都可以请帮助

1 个答案:

答案 0 :(得分:0)