I am a Junior DBA and i have to checks the various jobs on different servers.Please help me with a T-SQL way by which i can check the Job status through a Query.
Thanks in Advance
Jacx
you can use opennrowset or openquery to
query other servers
job information are stored in msdb and you can invoke the
following to query job information
use msdb
select * from sysjobs
select * from sysjobhistory
|||
tually i wanted a code to find the urrent job status of a particular job which i am inerested in. Kindly help me with that.
Thanks
Jacx
|||use msdb
select * from sysjobs sj join --<change the * to get only the columns you need
sysjobhistory sjh
on sj.job_id=sjh.job_id
where name like 'W%' <modify this for the job name
check the run status
check this link
http://msdn2.microsoft.com/en-gb/library/ms174997.aspx
No comments:
Post a Comment