March 8, 2006 at 3:40 am
Hi,
I want to search for the stored procedures which are using a particular keyword.Can anyone suggest me how to write a query for that?
..hema
March 8, 2006 at 4:39 am
Run in the desired data base from Query Analyzer:
declare @s varchar(255)
set @s-2 = 'Text to Search Here'
DECLARE @msg varchar(255) ,
@ul varchar(255)
select 'SP Name'=upper(o.name),
Seq=colid ,
'SP Line'=substring(text,patindex(@s,text)-5, 30)
from syscomments c ,
sysobjects o
where o.id=c.id
and patindex(@s,text) > 0
order by name
SELECT @msg='* Stored procedures containing string "' + @s-2 + '=' +
convert(varchar(8),@@rowcount) + ' *'
SELECT @ul=replicate('*',datalength(@msg))
Print ' '
PRINT @ul
PRINT @msg
Print @ul
GO
March 8, 2006 at 6:31 am
I want to know whether there is any
predefined system stored procedure for finding the same and thanx for the reply...
..hema
March 9, 2006 at 6:21 am
nothing predefined, but you can easily take Tyson's example and create a stored proc witht eh same code.
Lowell
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply