Search Stored Procedure Text

To search within stored procedures, do the following:

SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE CHARINDEX('findme', ROUTINE_DEFINITION) > 0

Or you can use sysobjects:

SELECT *
FROM sysobjects so
JOIN syscomments sm
ON sm.id = so.id
WHERE CHARINDEX('findme', sm.text) > 0

Comments are closed.

Featured Articles

 Site Author