Find procedures which has a specified parameter with a SQL script


The relevant INFORMATION_SCHEMA view that you could use is PARAMETERS. This query will list all stored procedures that have such a parameter:

Note: This Query also can use to find procedures that have a specified table, pass the table name in the parameter.

DECLARE @x=’myTableName’

SELECT DISTINCT p.SPECIFIC_NAME
FROM  INFORMATION_SCHEMA.PARAMETERS p
WHERE p.PARAMETER_NAME = '@x'

No comments:

Post a Comment

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...