News

Copyright © 2008-2015 Paula DiTallo

Tag Cloud



SQL Server: How Can I search for a specific text value in all the stored procedures?

To quickly look through your stored procedure objects for a text value in a database instance, do the following:

use [Metro]
go


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

Now, this is no replacement for a configuration management repository, but it will do in a pinch. BTW, remember this sql statement does NOT transcend all databases on the server, just a single db instance.

 

 

 

Monday, August 29, 2011 3:01 PM

Feedback

# re: SQL Server: How Can I search for a specific text value in all the stored procedures?

Handy tip! Thanks for sharing! 8/29/2011 4:03 PM | Dave

Post A Comment
Title:
Name:
Email:
Comment:
Verification: