Search code examples
mergereplicationtransactional

SQL server replication over replication


I have the following scenario :

-Server 1 have a data_server1 data base and a transactional publication (over internet) called TANS_PUB (9 tables article)

-Server 2 is a subscriber for TANS_PUB and have a local data base "data_server2"

Note: data_server1 and data_server2 have the same structure (schema) and the trans replication work very well

Now in server2 i created a merge publication (over internet and for all tables as articles) called MERG_PUB and i make server1 a subcriber to it. this merge pub is from data_server2 to data_server1_2 in server1. this replication also work very well.

the problem is : if one of the 9 table (in server1) (exemple TAB1), is updated manualy or by program, TAB1 in server2 is updated (by the replication based on TANS_PUB), but TAB1 in data_server1_2 (server1) is not update :-( ( in this case the MERG_PUB is not working), note if i update TAB1 in server2 manualy or by program TAB1 in data_server1_2 (server1) is well updated !!!!!

Can you help please ????

1000 thanks


Solution

  • It sounds like you are utilizing the republisher model with both Transactional and Merge Replication and updates originating upstream are not making it all the way downstream. In this model, by default, the Distribution Agent does not fire the Merge triggers when performing inserts/updates/deletes, and as a result the changes are not recorded in the Merge tracking tables so they never get replicated to the Merge subscribers.

    To alleviate this problem please set the Merge article property @published_in_tran_pub to true for all Merge articles participating in the Transactional publication.

    USE MergePublicationDB
    
    EXEC sp_changemergearticle 
      @publication = 'MergePublicationName',
      @article = 'MergeArticleName', 
      @property = N'published_in_tran_pub', 
      @value = N'true'
    GO