Skip to content

Instantly share code, notes, and snippets.

@yang-qu
Created November 30, 2016 02:57
Show Gist options
  • Select an option

  • Save yang-qu/7ec70cff39178b24f6dc243f08e2ff26 to your computer and use it in GitHub Desktop.

Select an option

Save yang-qu/7ec70cff39178b24f6dc243f08e2ff26 to your computer and use it in GitHub Desktop.
-- get a list of stored procedures
select * from sys.procedures
-- get sproc parameters names
SELECT name
FROM sys.parameters
WHERE object_id = OBJECT_ID('sproc name')
-- get sproc parameters name, type, and length
SELECT p.name AS ParameterName, t.name AS ParameterType, p.max_length AS ParameterLength
FROM sys.parameters AS p
JOIN sys.types AS t ON t.user_type_id = p.user_type_id
WHERE object_id = OBJECT_ID('sproce name')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment