title: Insert data into table using select & execute procedure
body: <p>I want to insert data into table using both select statement and executing procedures. </p>
  
  <p>That is... suppose a table 'TEMP' has 4 columns A,B,C,D. A &amp; B column values will be coming from SELECT statement and C, D column values will be come by executing any stored procedures. </p>
  
  <p>I have tried following but didn't facing error.</p>
  
  <pre><code>INSERT INTO TEMP
  SELECT R1.A, R1.B, R2.C, R2.D FROM 
  (SELECT A , B FROM SOME_TABLE) AS R1
  CROSS JOIN EXEC [dbo].[SOME_PROCEDURE] @SOME_VARIABLE1 ) AS R2
  </code></pre>
  
  <p>ERROR IS:</p>
  
  <pre><code>Incorrect syntax near the keyword 'exec'
  </code></pre>