Trigger on publisher duplicating row on subscriber.

  •  

    I have edited a replication SP so that if a row is updated at the publisher it creates a new row at the subscriber and marks the old row as deleted rather than over writing it.

    The problem is i have a trigger on the publisher table which update a datemodified column. This duplicates the transaction i.e once for the update and then again for the date trigger.

    Is there a way i can prevent the transaction produced by this trigger being replicated.

    The 'not for replication' option will not fix this as the duplicate transaction is not created at the subscriber.

     

    Thanks,

    Jules

    www.sql-library.com[/url]

  • Is it not possible to put some conditional logic around the update of the datemodified column to only update when the right conditions are met (deleted versus not deleted?).

    Also, I assume you are talking about having updated a MS replication stored proc? Why don't you transfer that logic to the trigger? This is a valid way if you know the users who are able to make changes at the publisher as opposed to those at the subscribers. This may not be so useful if you have users with the same login at subscriber and publisher.


    Regards,

    Steve

    Life without beer is no life at all

    All beer is good, some beers are just better than others

Viewing 2 posts - 1 through 1 (of 1 total)

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