• Aha - there's your problem. The NOT FOR REPLICATION option only prevents the trigger from firing when a replication agent is performing the action (insert, update or delete). The trigger still fires during the original action by the user. The idea behind NOT FOR REPLICATION is that you don't want the trigger to repeat the same action at the subscriber because the result of the trigger at the publisher is being replicated on its own, or otherwise just doesn't need to happen at the subscriber.

    Anyway, you have a cyclic loop between your trigger and the replication trigger, since your trigger is updating something in the table, which causes the replication trigger to fire again to update the msrepl_tran_version column, which causes your trigger to fire again, round and round. So, you will need the "IF UPDATE (msrepl_tran_version) RETURN" line in your trigger to prevent this.

    Jay Madren


    Jay Madren