title: Update columns in sequence
body: <p>I am busy writing a piece of SQL where I only want to update column 2 if the result from column 1 fits certain criteria.</p>
  
  <p>In the example below I am looking for some kind of syntax which will allow me to execute one update before proceeding to the next so I can use the result from the first in the second.</p>
  
  <pre><code>CREATE TABLE #Rows 
  (
  RowID INT IDENTITY
  ,Num1 INT 
  ,Num2 INT 
  )
  
  INSERT INTO #Rows
  (
  Num1,Num2)
  VALUES
  (1,10),
  (1,10)
  
  SELECT
      *
  FROM
      #Rows
  
  UPDATE
      #Rows
  SET 
      Num1 = CASE WHEN Num1 + Num2 &lt; 20 THEN 10 --Update 1 : I want this statement to execute first 
             END
     ,Num2 = CASE WHEN Num1 + Num2 = 20 THEN 100 ELSE 700 --Update 2 : I want this statement to execute after Update 1  
             END  
  SELECT
      *
  FROM
      #Rows
  
  DROP TABLE #Rows
  </code></pre>
  
  <p>The result I get is as follows:</p>
  
  <pre><code>RowID   Num1    Num2
  1       10      700
  2       10      700
  </code></pre>
  
  <p>I am hoping to get the following result:</p>
  
  <pre><code>RowID   Num1    Num2
  1       10      700
  2       10      100
  </code></pre>
  
  <p>Any ideas?</p>