65.9K
CodeProject is changing. Read more.
Home

Find particular word or text from the entire stored procedure

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.50/5 (6 votes)

Apr 26, 2011

CPOL
viewsIcon

11620

You can create a simple stored procedure like that:DECLARE @StringToSearch varchar(100)SET @StringToSearch = 'GetEmployee'SET @StringToSearch = '%' +@StringToSearch + '%'SELECT Distinct SO.NameFROM sysobjects SO (NOLOCK) INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID AND...

You can create a simple stored procedure like that:
DECLARE @StringToSearch varchar(100)
SET @StringToSearch = 'GetEmployee'

SET @StringToSearch = '%' +@StringToSearch + '%'
SELECT Distinct SO.Name
FROM sysobjects SO (NOLOCK)
   INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
   AND SO.Type = 'P'
   AND SC.Text LIKE @StringToSearch
ORDER BY SO.Name
GO