Tuesday, November 06, 2012

Returning the parameters for a specified stored procedure or function


Before you run the following query, replace <database_name> and <schema_name.object_name> with valid names.

USE <database_name>;
SELECT SCHEMA_NAME(schema_id) AS schema_name
    ,o.name AS object_name
    ,p.name AS parameter_name
    ,TYPE_NAME(p.user_type_id) AS parameter_type
FROM sys.objects AS o
INNER JOIN sys.parameters AS p ON o.object_id = p.object_id
WHERE o.object_id = OBJECT_ID('<schema_name.object_name>')
ORDER BY schema_name, o.object_name, p.parameter_id;


Reference: http://msdn.microsoft.com/en-us/library/ms190324.aspx

No comments: