Skip to main content

SQL query to list a Stored Procedure's parameter definitions, including parameter name, type, length and default values.

select
    substring(p.name, 1, 20) as ParameterName,
    substring(t.name, 1, 10) as DataType,
    p.max_length as [MaxLength],
    parameter_id as ParameterOrder,
    default_value as DefaultValue
from sys.parameters as p
inner join sys.types as t
    on p.user_type_id = t.user_type_id
where p.object_id = object_id('<schema>.<store_proc_name>')
order by
    parameter_id;