title: Sometimes SQL Server trigger is not firing
body: <p>I created a trigger on my <code>recharge</code> table. It updates the balance of <code>onaccountregistry</code> table. </p>
  
  <p>But sometimes when inserting rows into my <code>recharge</code> table it is not firing the trigger. Then values are mismatch. This <code>recharge</code> table insert rows every time.</p>
  
  <p>I created the trigger as follows. This is not a replicated table. I'm using SQL Server 2008 Enterprise edition.</p>
  
  <p>Please help me solve this matter</p>
  
  <pre><code>CREATE TRIGGER [dbo].[RechargeRefund] 
     ON [dbo].[ISRecharge]  
     FOR INSERT  
  AS
     declare @tin char(9) 
     declare @depocd char(1) 
     declare @oldvalue money
     declare @newvalue money
  begin
      select @tin = inserted.tin_subtin from inserted
      select @depocd = inserted.updatetype from inserted
      select @newvalue = inserted.DepositAmt from inserted
      select @oldvalue = Totdeposit from ISOnAcctRegistry where tin_subtin = @tin
  end
  
  if @depocd ='1'
  begin
    update ISOnAcctRegistry
    set Totdeposit = @oldvalue + @newvalue
    where tin_subtin = @tin
  end 
  
  if @depocd ='2'
  begin
    update ISOnAcctRegistry
    set Totdeposit = @oldvalue - @newvalue
    where tin_subtin = @tin
  end
  GO
  </code></pre>