title: The Transaction Ended In The Trigger The Batch Has Been Aborted
body: <p>I am using <code>Sql Server 2008</code>. I have a <code>Trigger</code> which updates my two other tables. I have read the Stack over flow this link <a href="https://stackoverflow.com/questions/7310820/transaction-has-ended-in-trigger-batch-has-been-aborted-derived-attribute">enter link description here</a>, but it does not full fill my needs. Below is my <code>Trigger</code></p>
  
  <pre><code>ALTER TRIGGER [Inventory].[StockUpdationOnIssue]
  ON              [Inventory].[StockIssueDetails]
  AFTER           INSERT  
  AS
  BEGIN
      BEGIN TRY
          BEGIN TRAN
                      INSERT INTO TableA 
                          (col1, col2,col3
                          )
                      SELECT      I.col1,I.col2,si.col3
                      FROM        inserted I
                      INNER JOIN  Inventory.StockIssue SI
                      ON          SI.StockIssueId = I.StockIssueId
  
                      INSERT INTO TableB
                          (col1, col2,col3
                          )
                      SELECT      I.col1,I.col2,si.col3
                      FROM        inserted I
                      INNER JOIN  Inventory.StockIssue SI
                      ON          SI.StockIssueId = I.StockIssueId
  
          COMMIT TRAN
      END TRY
      BEGIN CATCH
          SELECT ERROR_MESSAGE();
          RollBack Tran;
      END CATCH
  END
  </code></pre>
  
  <p>Below error is shown to me...</p>
  
  <p><img src="https://i.stack.imgur.com/Awbwi.png" alt="enter image description here"></p>