Technical Article

To retrieve Stored Procedure Parameters with Description

,

Use this procedure to get parameters for your stored procedure with data type,length, parameter position and also the mode of parameter (Input or Output).

Can be used to populate the dynamic parameters for any procedure.



Mohit Nayyar
MCP (.Net), MCSD, MCDBA

/*
Use this procedure to get parameters for your stored procedure with data type,length, parameter position and also the mode of parameter (Input or Output).
Can be used to populate the dynamic parameters for any procedure.
*/
create procedure getParam @Proc_Name varchar(255)
as 
--Just pass the procedure name to get all the parameters
select Specific_Name as 'Procedure_Name', Parameter_Name, Ordinal_Position as 'Param_Position',  case Parameter_Mode when 'IN' then 'Input' else 'Output' end as 'Mode', Data_Type, Character_Maximum_Length 'Data_Length'
from information_schema.Parameters where specific_name = @Proc_Name
go

exec getParam 'dt_addtosourcecontrol'

Rate

5 (2)

Share

Share

Rate

5 (2)