How to implement Unidirectional Merge Replication in SQL 2005

  • Hi,

    How to implement Unidirectional Merge Replication in SQL 2005.

    I have a DB which i need to make as publisher and the data which gets changed in this should be changed in the subscriber, but not vice versa, so please let me know how to go with this. Help me by providing few inputs.

    With Regards

    Dakshina Murthy

  • Use Transactional Replication... that's unidirectional

  • Hey Thanks a lot it works,

    rather if we try to insert in the subscriber it wont allow us and if we try to delete or update the same will not be affected to the publisher, i hope my observation is right. Thanks a lot once again.

    With Regards

    Dakshina Murthy

  • It won't stop you making changes at the subscriber... but they won't be replicated back to the publisher.

  • Ok thanks a lot

  • Ian, is right that usually if you want unidirectional replication, transactional replication should be the best option. But there are cases that that's not possible g.e. if you have tables without a PK.

    You can make merge replication unidirectional by using the Exchangetype parameter for the merge agent. While the default value (3) means bidirectional, a value of 1 would mean only chamges from the subscriber are synchronized. See here for more.

    [font="Verdana"]Markus Bohse[/font]

  • Hey,

    Thanks for the information.

    But how do i change the

    ExchangeType value to 2 using User Interface for an existing subscriber or while creating a new subscriber, where in the data changes made in publisher need to be affected in subscriber but not vice versa.

    With Regards

    Dakshina Murthy

  • dakshinamurthy (11/17/2008)


    But how do i change the

    ExchangeType value to 2 using User Interface for an existing subscriber or while creating a new subscriber, where in the data changes made in publisher need to be affected in subscriber but not vice versa.

    Dakshina Murthy

    When you create a subscription, a job is created which starts the merge agent (either continously or scheduled). You need to edit this job. The jobstep should look something like this:

    replmerg.exe -Publisher TESTSERVER -PublisherDB TEST_PUBS -Publication TEST_PUBS -PublisherSecurityMode 0 -PublisherLogin user1 -PublisherPassword password -DistributorSecurityMode 0 -DistributorLogin SqlUser1 -DistributorPassword password -Distributor TESTSERVER -Subscriber TEST -SubscriberDB TEST_PUBS -SubscriptionType 1 -SubscriberSecurityMode 0 -SubscriberLogin user1 -SubscriberPassword password -FileTransferType 0 -LoginTimeout 300 -QueryTimeout 600

    If the job is running, stop it and add the parameter like this "-ExchangeType 2" to the jobstep.

    [font="Verdana"]Markus Bohse[/font]

  • Hey All,

    Thanks a lot, it was really a great help for me from u all. I tried and it is working fine.

    With Regards

    Dakshina Murthy

  • Hey All,

    Sorry to trouble you again,

    will there be any problem if i change the -EXCHANGETYPE 2 using merge replication. Because i need to implement this in the Live Systems. I have tried the same in my Local Machine, it works but please dont mind, i just wanted to know will this give any problem later.

    With Regards

    Dakshina Murthy

  • I don't know why there should be any problem adding the parameter. It's a standard parameter for replmerge.exe fully supported by MS.

    [font="Verdana"]Markus Bohse[/font]

  • Hey,

    I am sorry as i was new to this i asked about this. Please dont mind and sorry again if my question turned a silly one.

    With Regards

    Dakshina Murthy

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply