title: SQL Server Update Trigger
body: <p>I have never used triggers before in SQL server and I have looked around online but haven't found an answer to my question.  Basically I am trying to write an Trigger that will run after a record has been updated in a table.  This trigger will then update two additional tables based on the record that was updated in the first table.</p>
  
  <p>The primary table with the trigger on it will be updating one record using a query like this:</p>
  
  <pre><code>UPDATE E.SM_T_RList
  SET IsActive = 0
  WHERE Guid = @Guid
  </code></pre>
  
  <p>I then want the trigger to do something like this:</p>
  
  <pre><code>ALTER TRIGGER [E].[IsActiveUpdate] 
  ON  [E].[SM_T_RList] 
  AFTER UPDATE
  AS
  BEGIN
  
  SET NOCOUNT ON;
  
  UPDATE E.SM_T_BInfo
  SET IsActive = 0
  WHERE Guid = @Guid
  
  UPDATE E.SM_T_RMachines
  SET IsActive = 0
  WHERE GUID = @GUID
  
  END
  </code></pre>
  
  <p>The Guid that I want updated is being used by the primary table. But I can't figure out how I get the @Guid that I want updated into the trigger?  Please help.</p>
  
  <p>Thanks</p>