Find a String in a Stored Procedure

Posted on Updated on

If you every decided to do something ridiculous and whatever you did requires that  all SP needs to be updated, here is how you can thumb through the SP in search of the string.

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE ‘%AS400%’
AND ROUTINE_TYPE=‘PROCEDURE’

Advertisements