title: getting number of records updated or inserted in sql server stored procedure
body: <p>I have an SP that inserts some records and updates others and deletes some. What I want is to return the count values of what was inserted and what was updated and what was deleted.  I thought I could use @@ROWCOUNT but that is always giving me a 1.</p>
  
  <p>After my INSERT I run: </p>
  
  <pre><code>PRINT @@ROWCOUNT
  </code></pre>
  
  <p>But my message console shows what really happened and this number:</p>
  
  <pre><code>(36 row(s) affected)
  1
  </code></pre>
  
  <p>So I can see that 36 records were actually updated but @@ROWCOUNT returned a 1.</p>
  
  <p>I am trying to do the same thing after the UPDATE and DELETE parts of the SP runs with the same result.</p>