title: SQL Server trigger is not firing on insert?
body: <p>For some reason this trigger does not fire.</p>
  
  <p>The trigger is active and data is being inserted to <code>p2</code> every 20 seconds. I have also tried try catch blocks and there is no exception.</p>
  
  <pre><code>ALTER TRIGGER [dbo].[load_to_p_2]
  ON [dbo].[p2]
  AFTER INSERT
  AS 
  BEGIN
      SET NOCOUNT ON;
  
      INSERT INTO [Log].[dbo].[Log] ([type], [message], [created_at])
      VALUES ('trigger load_to_p_2', '----', GETUTCDATE());
  END
  </code></pre>
  
  <p>And this is the code that inserts the data into <code>p2</code>:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[LoadTop2]  
  AS   
      SET NOCOUNT ON   
  
      DECLARE @r INT;  
      SET @r = 1;  
  
      WHILE @r &gt; 0  
      BEGIN  
          BEGIN TRANSACTION;  
              DELETE TOP (1000) 
              FROM pa3_log  
              OUTPUT deleted.id, deleted.browser INTO p2 (id, browser)  
  
              SET @r = @@ROWCOUNT;  
  
          COMMIT TRANSACTION;  
      END 
  </code></pre>