Reputation: 159
Here I have a sql script which retrieves all stored procedures and it's parameters.
select *
from sys.parameters
inner join sys.procedures on parameters.object_id = procedures.object_id
inner join sys.types on parameters.system_type_id = types.system_type_id
and parameters.user_type_id = types.user_type_id
--where procedures.name = 'STORED_PROC_NAME'
What I want to do is to be able to grab the stored procedures output parameters this way if at all possible.
If someone could point me to where in the sys
catalog views I can find this information, it would be appreciated! Thanks!
Upvotes: 0
Views: 256
Reputation: 37472
The column is_output
in sys.parameters
is 1, when it is an output parameter.
is_output bit 1 = Parameter is OUTPUT or RETURN; otherwise, 0.
So change your query to:
select *
from sys.parameters
inner join sys.procedures
on parameters.object_id = procedures.object_id
inner join sys.types
on parameters.system_type_id = types.system_type_id
and parameters.user_type_id = types.user_type_id
where parameters.is_output = 1;
Upvotes: 1