Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

Find all Stored Procedures having a given text in it

5.00/5 (2 votes)
25 Oct 2011CPOL 8.4K  
SELECT DISTINCT so.name FROM dbo.sysobjects so inner join .dbo.syscomments sc on so.id=sc.id WHERE so.xtype='P' AND sc.text like '%SearchString%'Much faster!
SQL
SELECT DISTINCT so.name 
FROM dbo.sysobjects so 
		inner join .dbo.syscomments sc on so.id=sc.id 
WHERE so.xtype='P' AND sc.text like '%SearchString%'

Much faster!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)