查找含有某字符的存儲過程
--查找存儲過程
select *
from sysobjects o
INNER JOIN syscomments c
ON o.id=c.id
WHERE o.xtype='P'
--查找用戶表
SELECT *
FROM sysobjects o
INNER JOIN syscolumns c
ON o.id=c.id
WHERE o.xtype='U'
--查找含有某字符的存儲過程
select DISTINCT o.*
from sysobjects o
INNER JOIN syscomments c
ON o.id=c.id
WHERE o.xtype='P'
AND c.text LIKE N'%10.201.253.4%'
--SELECT object_name(object_id)
--FROM sys.sql_modules where definition like '%10.201.253.4%'
--查看JOB
SELECT b.[name] [Job名称],CASE WHEN b.enabled=1 THEN '启用' ELSE '禁用' END [是否启用]
,b.description [Job描述],a.step_name [步骤名称],a.command [执行语句]
FROM msdb.dbo.sysjobsteps a INNER JOIN
msdb.dbo.sysjobs b ON a.job_id=b.job_id
WHERE a.command LIKE '%msdb%'