Getting parameter name from SQL Stored Procedure

I was trying to create an application which looks like SQL Enterprise manager using C#. I struggled with getting parameter name’s which is present in a Stored Procedure. Following query gives you all the parameters used in stored procedures.

SELECT * FROM INFORMATION_SCHEMA.PARAMETERS

Yes the above query will give all parameter in all stored procedures present in database. To filter with procedure specific parameters, use the following

SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE
specific_name = ‘ProcedureName’

Happy querying

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s