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

Snippets has posted 5883 posts at DZone. View Full User Profile

Find Text In SQL Code

01.18.2006
| 24481 views |
  • submit to reddit
        Simple stored procedure used to find text inside other SQL code - great for dependency checking during development.

Oskar Austegard
<a href="http://mo.notono.us">http://mo.notono.us</a>
ALTER PROC __FindText
	@query varchar(100)
AS
SELECT DISTINCT name, type 
FROM sysobjects so INNER JOIN syscomments sc ON so.id = sc.id
WHERE text LIKE '%' + @query + '%'
ORDER BY name