title: How to insert data into temp tables from a stored procedure which returns two select queries data
body: <p>I have a stored Procedure which will return two sets of data without any condition, I want to store that returned data in two temp tables.<br>
  Here's an example:</p>
  
  <pre><code>CREATE PROCEDURE sp1 
      -- Add the parameters for the stored procedure here
  
  AS
  BEGIN
      --  ON added to prevent extra result sets from
      -- interfering with SELECT statements.       
      -- Insert statements for procedure here
      SELECT * FROM table1        
      SELECT * FROM table2
  END
  GO 
  </code></pre>
  
  <p>create procedure sp2</p>
  
  <p>exec sp1 ---want to store result of table1 into temp1 and table2 into temp2</p>