Geeks With Blogs

News Copyright © 2008-2013 Paula DiTallo
Ask Paula! ...bringing you notes from the field...

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 Practical Answers , SQL | Back to top


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

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

Your comment:
 (will show your gravatar)
 


Copyright © Paula DiTallo | Powered by: GeeksWithBlogs.net | Join free