title: USING Common Table Expression and perform multiple update commands
body: <p>is it possible to us a CTE to perform multiple update commands?</p>
  
  <pre><code>With Query AS
  (
      SELECT
          Table_One.FOO AS FOO,
          Table_Two.BAR AS BAR
      FROM FOO
      JOIN BAR ON FOO.ID = BAR.ID
  )
  UPDATE
      Query.FOO = 1;
  UPDATE
      Query.BAR = 2;
  </code></pre>
  
  <p>In the example Query isn't available anymore on the second UPDATE command.</p>
  
  <p>EDIT:</p>
  
  <p>My working code looks like this:</p>
  
  <pre><code>With Query AS
  (
      SELECT
          Table_One.FOO AS FOO,
          Table_Two.BAR AS BAR
      FROM FOO
      JOIN BAR ON FOO.ID = BAR.ID
  )
  UPDATE
      Query.FOO = 1
  
  With Query AS
  (
      SELECT
          Table_One.FOO AS FOO,
          Table_Two.BAR AS BAR
      FROM FOO
      JOIN BAR ON FOO.ID = BAR.ID
  )
  UPDATE
      Query.BAR = 2;
  </code></pre>
  
  <p>Because you can't Update two Tables with one UPDATE command I need two Update commands.
  The problem right know is, that if I need to change the Select in the CTE I have to do it on two locations in the code.</p>