Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010

    Unanswered: Merge replication-SQL Server 2K - Duplicate rows in MSmerge_XX system table

    We have a scenario for Merge replication - MS SQL Server 2005 and client application for Sync up on .NET 3.5 Framework, where the system table MSmerge_current_partition_mappings is getting duplicate records for each client after a Sync is performed from a .NET Application.

    Thus whenever there is a new client sync-up, rows are getting appended along with the existing rows already present in the table.

    Currently there are more than 2000 clients doing a sync-up everyday. Due to this there are more than million records existing in this table. This can lead to a performance downgrade.

    The User tables of the application are not facing any duplicate records problem. Its only the system tables where the records are duplicated. Insertion of records in this table is a process handled internally by the Publication mechanism of MS SQL Server. There is hardly any coding involved as its handled internally by MS SQL Server.

    The findings are - When we did a Sync for Client-2, duplicate records for the first client were also present.

    This should be avoided.

    We were thinking of writing some Delete Scripts of deleting data from this system table, but there are other System Tables also involved when a Replication takes place. Some of them are -
    MSmerge_genhistory, etc.

    Kindly look into the same.

    Thanks in advance for the solution.

    Looking forward to it.

    Thanks and warm regards,
    Sameer Chachad.

  2. #2
    Join Date
    Jan 2003
    Nottinghamshire, UK
    Try explaining this again without mixing together the .NET app with SQL Replication.

    One of the two are failing and it doesn't help if you think speak of them both like this

    "Everything should be made as simple as possible, but not simpler." - Albert Einstein
    "Everything should be made as complex as possible, so I look Cleverer." - Application Developer

  3. #3
    Join Date
    Aug 2010
    Hi Williy,

    Good to see the first reply.

    The .NET code is just calling a sync process between the Publisher and the subscriber. So we can ignore the .NET for the time being.

    Talking about the Database part - the following is the count of the rows in the system tables after Publisher/Subsriber do a Sync -
    c_MSmerge_current_partition_mappings - 38055644
    c_MSmerge_past_partition_mappings - 16167
    c_MSmerge_contents - 84788
    c_MSmerge_partition_groups - 502
    c_MSmerge_genhistory - 5856
    c_MSmerge_tombstone - 7
    These system tables are getting records whenever there is a Insert/Update/Delete operation perfromed on the USer Tables or the tables participating in the Merge Publication (articles).
    Thus, the c_MSmerge_current_partition_mappings is the worry. The User Tables are fine. No duplication of records in these tables. Insertion of records in these tables is a process handled internally by the Publication mechanism of MS SQL Server.

    Hope I was able to explain the scenario.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts