title: MSSQL Trigger for update is working only once
body: <p>I'm going to create a trigger for update. Purpose of this trigger is that If <strong>muadurum</strong> column is changed , take the old value of <strong>mua_tarih</strong> in table fkayitlar and insert to another table <strong>mua_tarihleri</strong>.</p>
  
  <p>My code block like;</p>
  
  <pre><code>ALTER TRIGGER [dbo].[trgr_fkayit_update]
  ON [dbo].[fkayitlar]
  AFTER UPDATE
  AS
  DECLARE @mua_durum_once NVARCHAR(10)
  DECLARE @mua_durum_sonra NVARCHAR(10)
  DECLARE @mua_tarih_once DATE
  DECLARE @mua_yapan_once NVARCHAR(25)
  DECLARE @kisi_id INT
  </code></pre>
  
  <p>Take the old value;</p>
  
  <pre><code>SELECT
  @kisi_id=kayitid,
  @mua_durum_once=muayenedurum,
  @mua_tarih_once=muayenetarih,
  @mua_yapan_once=mua_yapan 
  FROM deleted
  </code></pre>
  
  <p>Take the new value;</p>
  
  <pre><code>SELECT @mua_durum_sonra=muayenedurum FROM inserted
  </code></pre>
  
  <p>Check if value is changed ; if changed, Insert @mua_tarih to table <strong>mua_tarihleri</strong> with <strong>@kisi_id</strong> and <strong>@mua_yapan_once</strong></p>
  
  <pre><code>  IF @mua_durum_once='OLDU' 
    AND @mua_durum_sonra='OLMADI' 
     AND @mua_tarih_once IS NOT NULL
     BEGIN
      INSERT INTO mua_tarihleri(kayitid,mua_tarihi,mua_yapan) 
          VALUES(@kisi_id,@mua_tarih_once,@mua_yapan_once)
       END
  </code></pre>
  
  <p>My problem is When I update more than one row in table fkayitlar,Trigger is working, but I see only one inserted row in table <strong>mua_tarihleri</strong> (only working once). I need to see more than one.(should be working more than once) <strong>Are not Triggers  working on more than one process?</strong> or <strong>How can I solve this my problem?</strong></p>