DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
SQL Server: Search Through Stored Procedures For Code
This returns the names of stored procedures that contain the text you're looking for.
select so.name as 'storProc' from sysobjects so join syscomments sc on so.id=sc.id where so.type='P' and sc.[text] like '%BIT_YOU_WANT_TO_FIND%'
Say for example you're looking for all the stored procedures that mentioned the table 'user_table' - then just use this script and the all the stored procedures that make mention of this will be returned.





