Add row count with SP executed for the report

  • Hi,

    I am trying to add total row count to an existing report which the result sets are based on executing SP (the SP use table variable to process complicate join with multiple tables and with some case statement, the reports is order based on the case statement) the last statement on SP is select from the table variable to get report result which populated back into report. How can i add row count in this situation ?

  • I would try a couple of different options.

    First, you could add a Row_Number() to the query and look for the last or max value of that column.

    Or, put the value of a row count query to your SP (SELECT @RowCount = COUNT(*) FROM yourTablehere) and then add the @RowCount variable as a column to your final output.

  • Thank you for the input, adding a row_count / hide it and get max of the value seems working perfect for me and a lot less work.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply