Skip to content

Instantly share code, notes, and snippets.

@muhdkhokhar
Created December 25, 2024 10:52
Show Gist options
  • Save muhdkhokhar/13a86a37a22ce051935d8b2231e98012 to your computer and use it in GitHub Desktop.
Save muhdkhokhar/13a86a37a22ce051935d8b2231e98012 to your computer and use it in GitHub Desktop.
SELECT
p.name AS ParameterName,
t.name AS DataType,
p.max_length AS MaxLength,
p.precision AS Precision,
p.scale AS Scale,
p.is_output AS IsOutputParameter,
CASE
WHEN p.is_nullable = 1 THEN 'Optional'
ELSE 'Mandatory'
END AS ParameterRequirement
FROM
sys.parameters p
INNER JOIN
sys.types t ON p.user_type_id = t.user_type_id
WHERE
p.object_id = OBJECT_ID('YourStoredProcedureName');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment