title: Merge Replication - Triggers firing on Both Publisher and Subscriber
body: <p>Server Version: SQL Server 2008R2
  Client Version: SQL Server Express 2008R2</p>
  
  <p>I have been encountering what appears to be locking issues when I run my merge replication process.  It appears to be when a change is made on the subscriber and sync'd with the publisher.  I am positive is coming from the triggers because it is appearing that they are firing on the publisher again and probably trying to send data down to the subscribers again.  I have added "NOT FOR REPLICATION" to the triggers, but that doesn't seem to be helping.  I also researched and tried adding the below clause as well.</p>
  
  <pre><code>DECLARE @is_mergeagent BIT
  
  SELECT @is_mergeagent = convert(BIT, sessionproperty('replication_agent'))
  
  IF @is_mergeagent = 0 --IF NOT FROM REPLICATION
  </code></pre>
  
  <p>That didn't seem to help either.  How do you handle Merge Replication with Insert / Update triggers? Can I prevent them from "Double" firing?</p>
  
  <p>Always appreciate the info.</p>
  
  <p>--S</p>