August 17, 2004 at 9:54 am
I'm looking for an automated way to search through all of the stored procedures in a single database for a specified text string. I'd like to be able to generate a list of all stored procedures which contain the text string.
August 17, 2004 at 10:40 am
Search in syscomments. A simple query
select * from syscomments where text like '%mystring%'
will get it for you. Surfinity also makes a great search engine for searching, but I'm not sure I'd use it on the system tables.
August 17, 2004 at 11:50 am
select so.name,
from sysobjects so
join syscomments sc
on so.id = sc.id
where sc.text like '% text to find %'
This will give you the name of the object
August 18, 2004 at 1:54 am
You can also use the OBJECT_NAME() function as in:
select OBJECT_NAME(id)
FROM syscomments
where text like '% text to find %'
Julian Kuiters
juliankuiters.id.au
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply