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.

 

 

 

posted on Monday, August 29, 2011 3:01 PM
Filed Under [ Practical Answers SQL ]

Comments

Gravatar
# re: SQL Server: How Can I search for a specific text value in all the stored procedures?
posted by Dave
on 8/29/2011 4:03 PM
Handy tip! Thanks for sharing!

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