Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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

share|improve this answer
    
Interesting... I was looking in the distribution system tables, I didn't even think to look in the actual database system tables. Now that you've found it for me it all seems so logical. –  RThomas Sep 27 '12 at 17:24
    
@RThomas I am glad I was able to help. In my environment, we have an SSIS package that collects this information, and sends alerts via email. It has been very handy. –  Matt M Sep 27 '12 at 17:28
    
Too easy, thanks again. I'm almost embarrassed I had to ask now that its all done. –  RThomas Sep 28 '12 at 0:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.