Thursday, 11 December 2008

Find stored procedures/functions that contain some text in SQL Server

DECLARE @text AS nvarchar(4000)
SET @text = '%text to find%'
SELECT name, xtype FROM sysobjects o
  INNER JOIN syscomments c ON o.id = c.id
  WHERE c.text like @text


* This source code was highlighted with Source Code Highlighter.

No comments: