查询存储过程字符串
select name
from sysobjects o, syscomments s
where o.id = s.id
and text like '%要查的字符串%'
and o.xtype = 'P' ORDER BY name
--查询存储过程被那些作业调用
SELECT *
FROM msdb.dbo.sysjobs JOB WITH( NOLOCK)
INNER JOIN msdb. dbo.sysjobsteps STP WITH(NOLOCK )
ON STP .job_id = JOB .job_id
WHERE STP .command LIKE N'% sp_name %'