See If Stored Proc Returns Data
-
I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?
Everything makes sense in someone's mind
-
I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?
Everything makes sense in someone's mind
Kevin Marois wrote:
Can SQL tell me the result of the query
Not without executing the code.
Never underestimate the power of human stupidity RAH
-
I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?
Everything makes sense in someone's mind
You can get the body-text of the sproc, and see if it contains a "RETURN" statement. That does not mean that the sproc actually returns something, that will depend on the logic. Return types will be defined for functions, not for sprocs.
Bastard Programmer from Hell :suss:
-
I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?
Everything makes sense in someone's mind
You would have to go into each procedure as you can return data with a select statement, thus looking for just return will not work.
-
I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?
Everything makes sense in someone's mind
Create Params passed to a Store Proc.. as local variables in Debug Code,,, and to check whether a SP returns data, execute the SP with those local variable with specified values.. by marking comment on Create or Alter Command on SP
- Happy Coding - Vishal Vashishta