select object_name(s.object_id)存储过程名, definition from sys.sql_modules s inner join sys.procedures p on s.object_id=p.object_id where definition like '%select name, id from person%'
--2000 select object_name(c.ID)存储过程名 ,text from syscomments c inner join sysobjects o on c.id=o.id where type='P' and text like '%select name, id from person%'
select a.name,b.text from sys.sysobjects a join syscomments b on (a.id = b.id) where a.type = 'p' and b.text like '%你要找的字符串%'
select a.name from sysobjects a inner join syscomments b on b.id = a.id where a.xtype = 'p' and b.text like '%你要查找的语句%'
definition
from sys.sql_modules s inner join sys.procedures p
on s.object_id=p.object_id
where definition like '%select name, id from person%'
select object_name(c.ID)存储过程名
,text
from syscomments c inner join sysobjects o
on c.id=o.id
where type='P' and text like '%select name, id from person%'
select a.name,b.text from sys.sysobjects a join syscomments b on (a.id = b.id)
where a.type = 'p' and b.text like '%你要找的字符串%'
select a.name
from sysobjects a inner join
syscomments b on b.id = a.id
where a.xtype = 'p' and b.text like '%你要查找的语句%'