Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


merge replication - "MSmerge_index_" The CREATE UNIQUE INDEX statement terminated


merge replication - "MSmerge_index_" The CREATE UNIQUE INDEX statement terminated

Author
Message
iBar
iBar
Mr or Mrs. 500
Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)

Group: General Forum Members
Points: 586 Visits: 840
Hi,

I am trying to create Merge replication with following steps and error below

1. Create DB - Publication and Subscriber on same instance
2. Create table with INT Identity primary key and few other nullable character columns - It has no FK.
3. Added column ROWGUIDCOL manually in tables at both side
4. updated ROWGUIDCOL with same value on both side
5. Added publisher
6. When i add subscriber, I am getting following error. I have tested this scenario with different table structure but of no use and even output file gives similar details

Question: I just want to understand, on which column it is trying to create unique index?

If ROWGUIDCOL has same value on both side and inface same table structure and data on both side and if merge replication checks for rowguid col for sync then what is the purpose of this error.

Thanks for your help.

Error messages:
Message: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.myTable' and the index name 'MSmerge_index_856103282'. The duplicate key value is (<NULL>Wink.
The statement has been terminated.
Command Text: sp_MSprepare_mergearticle
Parameters: @source_owner = dbo
@source_table = myTable
@publication = Publication_Testing
@qualified_tablename = [dbo].[myTable]

Stack: at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout)
at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout)
at Microsoft.SqlServer.Replication.Snapshot.ShilohPrepareMergeArticleWorkItem.DoVersionSpecificMergeArticlePreparation(SqlConnection connection)
at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
at Microsoft.SqlServer.Replication.Snapshot.PrepareMergeArticleWorkItem.PrepareMergeArticle(SqlConnection connection)
at Microsoft.SqlServer.Replication.MainWorkerThreadWrapper.Run()
at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoRegularMergeSnapshotPreparations()
at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoPreArticleFilesGenerationProcessing()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 1505)
Get help: http://help/1505
Server Production, Level 0, State 0, Procedure , Line 1
The statement has been terminated. (Source: MSSQLServer, Error number: 3621)
Get help: http://help/3621
Server Production, Level 0, State 0, Procedure , Line 1
The statement has been terminated. (Source: MSSQLServer, Error number: 3621)
Get help: http://help/3621

iBar
iBar
Mr or Mrs. 500
Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)Mr or Mrs. 500 (586 reputation)

Group: General Forum Members
Points: 586 Visits: 840
Ahh i got it .... there were few null rowguidcols which i have added after the update for testing

select rowguidcol, count(1)
from mytable
group by rowguidcol
having count > 1


Thanks for viewing.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search