Share via

SQL Business Logic Handler in Merge Replication

VDT-7677 171 Reputation points
2022-05-19T17:20:19.523+00:00

Hi,

Running SQL Server 2008 R2 in a merge replication topology. Publisher and distributor are on same machine. Subscribers use pull subscriptions.

We have a requirement to implement a Business Logic Handler for conflict resolution on a Merge Article which uses row-level tracking. The merge article in question has several child articles related to it via join filters (unique key, rows in joined table relate to exactly one row in filtered table). The join filter is not defined as a logical record.

In terms of designing our Business Logic Handler, are there any considerations to be taken into account when factoring in the relationship defined by the join filters?

Essentially I'm looking to confirm that (should the Business Logic Handler determine that the publisher's dataset is to be accepted and the subscriber's dataset rejected) no modifications (inserts, updates or deletes to the parent row or child table rows in question) from the subscriber would be propagated the publisher, and that the publisher's dataset would be propagated back to the subscriber.

Any assistance you could provide would be greatly appreciated!

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 22,431 Reputation points Microsoft External Staff
    2022-05-20T02:31:59.767+00:00

    Hi @VDT-7677 ,

    A filter must not include the rowguidcol used by replication to identify rows. By default this is the column added at the time you set up merge replication and is named rowguid.

    If you add, modify, or delete a join filter after subscriptions to the publication have been initialized, you must generate a new snapshot and reinitialize all subscriptions after making the change.

    Join filter performance can be optimized by following these guidelines:

    •Limit the number of tables in the join filter hierarchy.
    •Set the join unique key option to True where appropriate.
    •Ensure that the columns referenced in join filters are indexed.
    •Do not create row filters that mimic join filters.

    Please refer to below MS document to get more information.

    Join Filters
    Define and Modify a Join Filter Between Merge Articles


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.