title: Creating a trigger to update multiple records after insert sql server 2008
body: <p>Well basically I need this trigger to work after a user inserts multiple records into the database. So that when an optionID of 0 is inserted and the IsoptionalID = 1, then set the OptionID = NULL</p>
  
  <pre><code>CREATE TRIGGER ThisDatabase
     ON  OtherTable
    AFTER INSERT
  AS 
  BEGIN
  
  DECLARE @OPTIONID INT
  SET @OPTIONID = OtherTable.OPTIONID
  
  DECLARE @ISoptional INT
  SET @ISoptional = OtherTable.ISoptional
  
          CASE @optionID WHEN  0 and @ISoptional = 1 set update  OtherTable set optionid = null end
  END
  </code></pre>
  
  <p>I am not sure about the case itself either.</p>
  
  <p>Thank you in advance</p>