The total number of result sets in the stored procedure

In SQL Server 2008, is there a way to get the total number of result sets (tables) populated after the stored procedure is executed.

Suppose I have one stored procedure that internally calls another stored procedure. I want to know how many returned results an internally called stored procedure returns.

Can anyone help me on this.

eg.

CREATE PROCEDURE sp_GetReports
(
    @reportName AS VARCHAR(50)
)
AS
BEGIN
    DECLARE @reportProcName AS VARCHAR(50)

    SELECT  @reportProcName = ReportProcName
    FROM ReportMaster
    WHERE ReportName = @reportName;

    EXEC (@reportProcName)

    /*
    * Need to get here, total numbers of Result Sets (tables) retrived.
    */


END
GO

Thanks in advance.

+4
source share
2 answers

How about a workaround?

. SELECT . sproc. .

0

@@ROWCOUNT sp_GetReports.

-1

All Articles