title: SQL Server Update / Modified Date Field
body: <p>I am using the following trigger to track the last modified date in a table:</p>
  
  <pre><code>CREATE TRIGGER trg_UpdateTimeEntry
  ON dbo.TimeEntry
  AFTER UPDATE
  AS
      UPDATE dbo.TimeEntry
      SET ModDate = GETDATE()
      WHERE ID IN (SELECT DISTINCT ID FROM Inserted)
  </code></pre>
  
  <p>It says "AFTER UPDATE", but even when I insert a row, it sets the ModDate column to the same as the entry date. How can I stop this from happening? I only want it to change when I make a chance to a row, not when a new row is added (it should stay NULL in this case).</p>
  
  <p>Thanks!</p>