Sql-server – Merge Replication: Where are rowguids of conflict losers stored

merge-replicationsql-server-2008

I'm trying to obtain the row guid of all the merge replication conflict losers listed in my conflict viewer. The bug that was allowing the conflicts to occur has been identified and resolved but now I need to go and remove the conflict losers from the subscribers so that they quit trying to upload the rows in conflict with each new sync.

I can go through each conflict individually to obtain the rowguid but there are a couple thousand of them. So, surely there's got to be a query I can write to obtain this data in one swoop.

Anyone have experience querying the merge replication system tables for conflict info or know which system table I should be looking in. I'm not finding much help out on the interwebs.

Best Answer

Straight from Advanced Merge Replication Conflict Detection and Resolution:

The Conflict Viewer displays information from three system tables:

  • Replication creates a conflict table for each table in a merge article, with a name in the form MSmerge_conflict__.

  • Conflict tables have the same structure as the tables on which they are based. A row in one of these tables consists of the losing version of a conflict row (the winning version of the row is in the actual user table).

  • The MSmerge_conflicts_info table provides information about each conflict, including the conflict type.

  • The sysmergearticles table identifies which user tables have conflict tables and provides information about the conflict tables.

This means that if you find a record in the MSmerge_conflict_[PublicationName]_[ArticleName] table, it is the "loser". The record that you find in the actual table is the "winner".

Hope this helps,

Matt