Jan 2, 2010

Searching Stored Procedures & Functions based on the text

The below script is used to get the list of Stored Procedures based on their text.

SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_DEFINITION LIKE 'Text To Be Searched'


To search for the functions, the ROUTINE_TYPE needs to be changed to FUNCTION as shown below.


SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION' AND ROUTINE_DEFINITION LIKE 'Text To Be Searched'

No comments:

Post a Comment