to see the Job details in Sql server through t-SQL


Hi All,

If you want to see the jobs status with out going to sql server agent, please run the below query

use msdb

go

select distinct j.Name as "Job Name", j.description as "Job Description", h.run_date as LastStatusDate,

case h.run_status

when 0 then ‘Failed’

when 1 then ‘Successful’

when 3 then ‘Cancelled’

when 4 then ‘In Progress’

end as JobStatus

from sysJobHistory h, sysJobs j

where j.job_id = h.job_id and h.run_date =

(select max(hi.run_date) from sysJobHistory hi where h.job_id = hi.job_id)

order by 1

And if you want to see the dtspackages that are installed in your sql server, run the below query

select * from msdb..sysdtspackages

If you have other options, please post, I will post in the thread.

Thanks for viewing.

Regards,

Chaitanya,

Webiste : https://mssqlbuzz.wordpress.com/

To Send Mail : mssqlbuzz

Leave a comment

Design a site like this with WordPress.com
Get started