Stored Procedure question

Stimulsoft Reports.WEB discussion
Post Reply
cbrydon
Posts: 173
Joined: Fri May 30, 2014 4:37 pm

Stored Procedure question

Post by cbrydon »

Hello,

I've started working with a a very basic stored procedure in MSSQL and have a couple of questions.

I have a stored procedure that has 1 input parameter (a DepartmentID ) and the stored procedure
returns all rows from a table for that given department ID.

I can get columns and data returned from a stored procedure when I use the following syntax
EXEC CarlsTest 8 and the type of datasource is set to Query
StoredProcQuery.png
StoredProcQuery.png (8.75 KiB) Viewed 619 times
I can also get the results I want if I have the datasource setup as a Stored Procedure and use a
parameter to store the DeptID.
StoredProcSP.png
StoredProcSP.png (17.75 KiB) Viewed 618 times
Is there any advantage to using one method over another or does it just depend on personal
preference and/or the type of query being written?

For a more complex stored procedure is there a performance difference between running a
stored procedure with EXEC (and the datasource type as Query) versus running the stored
procedure with the datasource type as Stored Procedure.

Thank you,
Carl
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Stored Procedure question

Post by Lech Kulikowski »

Hello,

Please check the following discussion:
https://stackoverflow.com/questions/598 ... ts-on-mode

Thank you.
cbrydon
Posts: 173
Joined: Fri May 30, 2014 4:37 pm

Re: Stored Procedure question

Post by cbrydon »

OK - Thank you Lech.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Stored Procedure question

Post by Lech Kulikowski »

Hello Carl,

You are welcome.
Post Reply