title: SQL Server stored procedure export to Excel workbook with multiple sheets
body: <p>How can I export to an Excel workbook from a stored procedure to multiple sheets with few sql statements?</p>
  
  <p>I am currently using the following statement:</p>
  
  <pre><code>EXEC proc_generate__excel 'db', 'temp',@filename, @SeqNo, @ext, @sqlorder
  </code></pre>
  
  <p>It will create three Excel workbooks, if there are three sql statement.</p>
  
  <p>How can I export data from three sql statement to <strong>three sheets in one Excel workbook</strong>? </p>