There may be times when it would be nice to know what stored procedures have parameters with a certain name. For example, what procedures have a parameter named "username?" Using SQL Server it's just a matter of querying some of the system tables to find out.
NOTE: Set the value in the DECLARE line at the top to the parameter name to look for (partial strings are fine).
NOTE: Set the value in the DECLARE line at the top to the parameter name to look for (partial strings are fine).
DECLARE @parameter VARCHAR(MAX) = 'PARAMETERNAME'
SELECT
sys.all_parameters.name AS parameterName
,sys.all_objects.name AS storedProcedureName
FROM
sys.all_objects
INNER JOIN sys.all_parameters
ON sys.all_objects.object_id = sys.all_parameters.object_id
WHERE sys.all_parameters.name LIKE '%' + @parameter + '%'
Comments
Post a Comment