Never been to DZone Snippets before?

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 (See related posts)

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.

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts