Here's a sample SP that spins through the first 15 SPs it encounters in the schema and saves every line with the EXEC command on it:
declare @l_croutine_name sysname
select top 15 routine_name, 0 as processed into #spinnit
from information_schema.routines
where routine_type = 'PROCEDURE'
create table #mysptext (spname sysname NULL, sptext varchar(2000))
while (select count(*) from #spinnit where processed = 0) > 0
begin
select top 1 @l_croutine_name = routine_name from #spinnit where processed = 0
insert #mysptext (sptext) exec sp_helptext @l_croutine_name
update #mysptext set spname = @l_croutine_name where spname is NULL
update #spinnit set processed = 1 where routine_name = @l_croutine_name
end
select * from #mysptext
where charindex('exec',sptext) > 0
drop table #spinnit
drop table #mysptext
Enjoy.
Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
-----------
A skeleton walks into a bar, and says "I'll have a beer and a mop.