Search This Blog

Monday, March 7, 2011

SQL DBA - To Get all the JOB Details/

select, case job.enabled when 1 then 'Enabled' else 'Disabled' end [Enabled], stp.step_name, stp.subsystem, stp.database_name, as scheduleName,

case ss.freq_type when 1 then 'One Time'

when 4 then 'Daily'

when 8 then 'Weekly'

when 16 then 'Monthly'

when 32 then 'Monthly - relative'

when 64 then 'When Agent Starts'

when 128 then 'When Computer is idle' else 'Invalid' end Freq_Type,

stp.command from msdb..sysjobs job left outer join msdb..sysjobsteps stp on (job.job_id = stp.job_id ) left outer join msdb..sysjobschedules sjc on ( job.job_id = sjc.job_id ) left outer join msdb..sysschedules ss on (sjc.schedule_id = ss.schedule_id)


No comments: