Page 1 of 1

Access stored procedures return value

Posted: Tue Jul 15, 2014 8:23 am
by keris
How can I access the return value of a stored procedure in a report ?

Sample:

CREATE PROCEDURE SomeSP
AS
declare @rows int = (Select Count(*) from someTable)
Select TOP 100 from someTable
return (@rows)
END;

In that case I want to display the returned @rows count in the report.

Thanx
peter

Re: Access stored procedures return value

Posted: Tue Jul 15, 2014 12:18 pm
by Alex K.
Hello,

As a way, try to use the following procedure:
...
declare @rows int = (Select Count(*) from someTable)
Select TOP 100 *, @rows from someTable
...
Thank you.

Re: Access stored procedures return value

Posted: Tue Jul 15, 2014 3:02 pm
by keris
Hi Aleksey,

that generates too much oveerhead. The use case for that handling deals with large row count.

Is there maybe a hook/event or override in the report where i can add an additional parameter with direction ReturnValue ?

Thanx
Peter

Re: Access stored procedures return value

Posted: Wed Jul 16, 2014 6:31 am
by Alex K.
Hello,

Unfortunately, the output parameters does not supported.
As a way you can add additional datasource in report in which calculate a row count in table.
Select Count(*) as rowCount from someTable

Thank you.

Re: Access stored procedures return value

Posted: Wed Aug 13, 2014 4:54 am
by keris
Hello,
I've choosen your proposal to add an additional column to the result set. That's less overhaed as initially expected.
Thanx
Peter

Re: Access stored procedures return value

Posted: Wed Aug 13, 2014 5:42 am
by Alex K.
Hello,

Let us know if you need any additional help.

Thank you.