title: Combining INSERT INTO and WITH/CTE
body: <p>I have a very complex CTE and I would like to insert the result into a physical table. </p>
  
  <p>Is the following valid?</p>
  
  <pre><code>INSERT INTO dbo.prf_BatchItemAdditionalAPartyNos 
  (
      BatchID,
      AccountNo,
      APartyNo,
      SourceRowID
  )       
  WITH tab (
    -- some query
  )    
  SELECT * FROM tab
  </code></pre>
  
  <p>I am thinking of using a function to create this CTE which will allow me to reuse. Any thoughts?</p>