Searching for a string across all of the stored procedures in a database is something that I always forget how to do and then have to quickly browse Google for..
I’m not sure why this isn’t built into the MSSQL management tools but it’s super easy and can save a bunch of time if you’re bug hunting.
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%find me please%'
AND ROUTINE_TYPE='PROCEDURE'







Comments