title: Return number of rows affected by UPDATE statements
body: <p>How can I get the number of rows affected by an UPDATE query in a Stored Procedure (SQL Server 2005), as a resultset. e.g.</p>
  
  <pre><code>CREATE PROCEDURE UpdateTables
  AS
  BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;
  
      UPDATE Table1 Set Column = 0 WHERE Column IS NULL
      UPDATE Table2 Set Column = 0 WHERE Column IS NULL
      UPDATE Table3 Set Column = 0 WHERE Column IS NULL
      UPDATE Table4 Set Column = 0 WHERE Column IS NULL
  END
  </code></pre>
  
  <p>Then return:</p>
  
  <pre><code>Table1    Table2    Table3    Table4
  32        45        0         3
  </code></pre>