--查询哪些存储过程用到这个表了
SELECT DISTINCT
b.name,
b.type
FROM dbo.syscomments a,
dbo.sysobjects b
WHERE a.id = b.id
AND b.xtype = 'p'
AND a.text LIKE '%FHFX_JCSJGL%'
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'%p_easfhsjtq%'