Monday, May 6, 2013

Find/Search keyword or text in all stored procedures in Sql Server Database

Suppose you want to check a table name wherever it has been used in the stored procedures of the database.

The Query to check this :


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


Example:


No comments:

Post a Comment