question

Kirman avatar image
Kirman asked

How to get the count of Input Parameters and their names in SP ?

Hi, I need to find out the count and name of the Input parameters in SP I dont know which System Table has to be accessed to get this meta data for the Stored Procedure. Thanks
stored-proceduresparameters
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
`sys.parameters` is the one that has the detail you need select so.name as ProcName, sp.name as ParameterName from sys.objects so join sys.parameters sp on so.object_id = sp.object_id where so.type='P' Same can also be found in information schemas select [Specific_name], [PARAMETER_NAME] FROM INFORMATION_SCHEMA.PARAMETERS;
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pavel Pawlowski avatar image Pavel Pawlowski commented ·
Ah Kev, you have been a few secs quicker. :-)
0 Likes 0 ·
Pavel Pawlowski avatar image
Pavel Pawlowski answered
Information about parameters is in the `sys.parameters` system table To list parameters of a stored proc, you can use SELECT * FROM sys.parameters WHERE object_id = OBJECT_ID('procName')
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.