Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to find status of SQL Job - Please help

Author  Topic 

dineshsatam
Starting Member

19 Posts

Posted - 2007-09-09 : 13:55:09
T-SQL for checking which jobs are currently running ?
And
what happen if index rebuild job overlap with shrink log file job
Is database wont allow to insert or update for other application


Thanks in Advance


Dina Satam

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-09-09 : 16:51:41
sp_help_job [[@job_id =] job_id]
[,[@job_name =] 'job_name']
[,[@job_aspect =] 'job_aspect']
[,[@job_type =] 'job_type']
[,[@owner_login_name =] 'login_name']
[,[@subsystem =] 'subsystem']
[,[@category_name =] 'category']
[,[@enabled =] enabled]
[,[@execution_status =] status]
[,[@date_comparator =] 'date_comparison']
[,[@date_created =] date_created]
[,[@date_last_modified =] date_modified]
[,[@description =] 'description_pattern']




Specifically you want to look for execution status.
For currently running you can type ( in MSDB)


SP_HELP_JOB @EXECUTION_STATUS=1

1 is Executing, see books online for more.




Future guru in the making.
Go to Top of Page
   

- Advertisement -