title: How to use update trigger to update another table?
body: <p>I am new to triggers and want to create a trigger on an update of a column and update another table with that value.</p>
  
  <p>I have table1 with a year column and if the application updates that year column I need to update table 2 with the year the same year.</p>
  
  <pre><code>ALTER TRIGGER [dbo].[trig_UpdateAnnualYear]
     ON  [dbo].[table1]
     AFTER UPDATE
  AS 
  
  if (UPDATE (intAnnualYear))   
  BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;
  
      -- Insert statements for trigger here
  
      Update table2 set AnnualYear = intAnnualYear where table2.ID = table1.ID
  END
  </code></pre>