Sunday, August 9, 2009

Find specific text in stored procedures

From http://databases.aspfaq.com/database/how-do-i-find-a-stored-procedure-containing-text.html

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%foobar%'
AND ROUTINE_TYPE='PROCEDURE'


select * from information_schema.routines
where ROUTINE_DEFINITION LIKE '%foobar%'