title: Return number of rows affected with multiple queries
body: <p>I'm writing some dynamic SQL in SQL Server. There are a few queries combined into one. The first query selects data, the second deletes, the third inserts, and the last deletes a temp table:</p>
  
  <pre><code>SET @completeSQL = @tempProdSQL + @deleteSQL + @insertSQL + ' DROP TABLE #tempProd'
  
  PRINT(@completeSQL)
  
  EXEC sp_ExecuteSQL @completeSQL
  
  SET @archiveSize = @@ROWCOUNT
  </code></pre>
  
  <p>I know that I can use <code>@@Rowcount</code>, but I'm getting a value of 0. I believe this is because the last command is to drop the table. </p>
  
  <p>Is there a way to get the rows affected after the <code>@tempProdSQL</code> command? I would prefer to not separate the execution if it will impact performance.</p>