Creating a stored procedure for an SSRS report
Before creating the report definition, we must create a stored procedure that will be used as the data source for the report. This stored procedure is to be called Rpt_UserTaskSp.
Note: When creating stored procedures and other system elements, we recommend strongly that you follow the naming conventions already in place. For example, with this stored procedure, we identify it as a stored procedure to use in conjunction with reports using the prefix Rpt. We identify it as a stored procedure with the suffix Sp.
To create the stored procedure for this example: