0

我们在 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

下面是表结构

在此处输入图像描述

我需要在不删除/重新创建订阅的情况下解决此问题。谁能帮忙

4

1 回答 1

0

问题是数据库和索引已损坏。在以下链接之后修复

https://dba.stackexchange.com/questions/16113/unique-index-corrupted-sql-select-query-returns-single-row-but-create-unique-in

于 2012-04-10T11:39:34.853 回答