Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2011

    Unhappy Unanswered: Merge Replication filteration


    I am stuck in a scenario related to dynamic filtering of Merge Replication:
    Here it is:

    HOSTNAME() is associated with a set of keys (say, ‘CustomerIDs’), and all other entities in the database are associated to 1 or more CustomerIDs.
    So, the data is filtered based on the CustomerIDs associated to a HOSTNAME().
    When I create a subscription, the data is replicated properly.
    Now, for an existing subscription when I associate a CustomerID with the HOSTNAME(), the existing records associated to that CustomerID are not getting replicated until a do a 'reinitialize' at the subscriber.

    I hope this is supported and i am missing something obvious.

    Any help is much appreciated.


  2. #2
    Join Date
    Jul 2003
    San Antonio, TX
    But you have to reinitialize the subscription when you change its definition (and filtration is part of the definition).
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Jan 2011
    I dint explain this properly actually, I have a table which associates a set of Host_Names and CustomerIDs, this data is not filtered/replicated but the main data is filtered based on this table.

    I got the actual problem, I was using a UDF to get the customerIDs associated to a host_name and filtered the main 'Customer' table on that.
    So, when I was inserting a new record in the HostName-CustID mapping table, being not the main filter, it wasnt triggering any new records to replicate.

    The solution was to replicate the mapping table itself and have the main filter on it, and then join the main 'Customer' table with the mapping table. In this way, any insert/update/delete in the mapping table will trigger the inserts/deletes in the subscription data.

    Hope its clear and useful to others.

Tags for this Thread

Posting Permissions

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