Just replace %foobar% with any keyword and run. The MSForEachDB will cycle through every database on the instance and search every stored procedure for you.
You can change the Routine_Type to be VIEW as well and it will search all views!
Jim Youmans,
2013-05-30 (first published: 2013-05-22)
Just replace %foobar% with any keyword and run. The MSForEachDB will cycle through every database on the instance and search every stored procedure for you.
You can change the Routine_Type to be VIEW as well and it will search all views!
EXEC sp_MSForEachDB 'USE ?; SELECT DB_NAME(), ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE ''%foobar%'' AND ROUTINE_TYPE = ''PROCEDURE'''
Easiest way to search for a string in any object within the database.
2013-08-08 (first published: 2013-07-29)
2,286 reads
Learn how to search for a value throughout all database tables.
Searches for objects (including CLR) who's names contain the search string. outputs IDs, names, and types of the object and its parent.
2009-10-06 (first published: 2009-09-22)
1,150 reads
Searches for actual and potential foreign key columns for a given primary key reference.
2009-10-12 (first published: 2008-06-20)
2,491 reads
ow to write a stored procedure that permits users to select among many search conditions, using both dynamic and static SQL.
2008-03-25
3,820 reads