Is there any way to get total row count and size of result-set generated by a stored procedure execution?

@@ROWCOUNT is a good option if its already added in each stored procedure but I just want something like all RPC calls with in specific time period, with Row count and Size (in Bytes or KBs) for each call without modifying any stored procedure.


The question is unanswerable as asked since stored procedures do not produce result sets. Only (certain) statements produce result sets. Executing procedures may produce none, one or more results sets depending on the statements contained and the branches executed.

For statements the row count will be tracked in sys.dm_exec_query_stats.

Result sets have no size (in bytes or KB), size is an attribute pertinent only to encoding and representation. A sensible question would be to ask how many bytes are transferred between the client and the server, and this can be tracked by transport performance counters.

  • Basically, one of our client database contains huge data and some stored procedure (of thousands of stored procedures) calls are generating too much data (occasionally) to fill all application pool size. I just need to track-down exact stored procedure which are causing such huge result-sets. – Aasim Abdullah May 15 '15 at 11:03
  • Use sys.dm_query_exec_stats – Remus Rusanu May 15 '15 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.