0

I have a job set up in SQL Server called "Retreat Update". It is a job that the SQL Server Agent runs every 45 minutes. Is there a SELECT statement or a system stored procedure that I can execute to determine if the job is currently running or if its idle?

Icemanind
  • 47,519
  • 50
  • 171
  • 296

1 Answers1

2

I think you can use sp_help_job to see the status of the jobs on the server. You can see more information on it here.

From my search on SQL Help, try...

EXEC dbo.sp_help_job @Job_name = 'Retreat Update'

enter image description here

Christian Phillips
  • 18,399
  • 8
  • 53
  • 82
  • This worked. One of the fields returned is 'current_execution_status'. MSDN doesn't tell you what the number means though. For anyone interested though, here is [a link describing the return numbers](http://ranjithk.com/2010/04/23/dynamically-getting-the-execution-status-of-a-sql-server-agent-job/) – Icemanind Sep 25 '13 at 19:33
  • @icemanind, I posted the link above which has a table to `@execution_status` – Christian Phillips Sep 25 '13 at 19:34