--作业查询
SELECT a.name 'JobName' ,
b.step_name 'StepName' ,
d.name ,
b.command
FROM msdb.dbo.sysjobs a
INNER JOIN msdb.dbo.sysjobsteps b ON a.job_id = b.job_id
INNER JOIN msdb.dbo.sysjobschedules c ON a.job_id = c.job_id
INNER JOIN msdb.dbo.sysschedules d ON c.schedule_id = d.schedule_id
WHERE a.enabled = 1
AND d.enabled = 1