title: How to disable SQL Server trigger for current process only?
body: <p>Can someone double-check my trimmed-down example?  When the Documents table is updated, I want it update the EntryDate on the Queue table.  However, I don't want the trigger on the Queue table to fire for THIS PROCESS ONLY.  Meaning, if some other process updates the EntryDate on the Queue table while this process would be running, I WOULD want the trigger on the Queue table to fire for that particular transaction.  I'm not sure if I need to do any kind of lockout for the below code to ensure no other process gets its toes stepped on.  Thanks!</p>
  
  <pre><code>create trigger [dbo].[Documents_trigUpdate] on [dbo].[Documents]
  for update
  as
  
  begin transaction
  
  alter table [Queue] disable trigger Queue_trigUpdate
  update  [Queue] set EntryDate = getdate()
  alter table [Queue] enable trigger Queue_trigUpdate
  
  commit transaction
  
  go
  </code></pre>