title: How do you get summarized statistics on a whole set of queries in SQL Server 2008
body: <p>I'm trying to tune a few mechanics for operations I make on a database in SQL Server 2008.</p>
  
  <p>In order to pick the best approach of the problem I often use <code>SET STATISTICS IO ON</code>, but it's not really handy when I compare a long set of statements with another.</p>
  
  <p>So for example, how could I know the whole reads/writes it takes to a T-SQL statement like the following:</p>
  
  <pre><code>WHILE @i &lt; 1000
  BEGIN
   &lt;some statements&gt;
   SET @I = @I + 1
  END
  </code></pre>
  
  <p>Thank for your help (forgive me for my poor English).</p>