Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 无法在对象';dbo.MSmerge#u contents';具有唯一索引_Sql_Sql Server 2008_Indexing_Replication_Merge Replication - Fatal编程技术网

Sql 无法在对象';dbo.MSmerge#u contents';具有唯一索引

Sql 无法在对象';dbo.MSmerge#u contents';具有唯一索引,sql,sql-server-2008,indexing,replication,merge-replication,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

我们在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
在错误中,它提到“
无法在具有唯一索引“nc2MSmerge_contents”的对象“dbo.MSmerge_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
以下是表格结构


我需要在不删除/重新创建订阅的情况下修复此问题。有人能帮忙吗?问题是数据库和索引已损坏。固定后,下面的链接