Skip to content

Instantly share code, notes, and snippets.

@haroldcris
Created March 20, 2018 10:14
Show Gist options
  • Select an option

  • Save haroldcris/cdee2e44045e52101834f72ee938f9bc to your computer and use it in GitHub Desktop.

Select an option

Save haroldcris/cdee2e44045e52101834f72ee938f9bc to your computer and use it in GitHub Desktop.
Get MS Sql Parameters from Stored Procedure
SELECT SCHEMA_NAME(SCHEMA_ID) AS [Schema],
SO.name AS [ObjectName],
P.parameter_id AS [ParameterID],
P.name AS [ParameterName],
TYPE_NAME(P.user_type_id) AS [ParameterDataType],
P.max_length AS [ParameterMaxBytes],
P.is_output AS [IsOutPutParameter]
FROM sys.objects AS SO
INNER JOIN sys.parameters AS P
ON SO.OBJECT_ID = P.OBJECT_ID
WHERE SO.OBJECT_ID IN ( SELECT OBJECT_ID
FROM sys.objects
--WHERE TYPE IN ('P','FN'))
where so.name = 'enrolment_delete'
)
--ORDER BY [Schema], SO.name, P.parameter_id
--GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment