Stored Procedure question
Posted: Mon Aug 08, 2022 11:53 am
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 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. 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
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 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. 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