The CurrentRunStatus property returns the executing state of a SQL Server Agent job.
object.CurrentRunStatus
object
Expression that evaluates to an object in the Applies To list
Long, enumerated.
Read-only
HRESULT GetCurrentRunStatus(
SQLDMO_JOBEXECUTION_STATUS* pRetVal);
The CurrentRunStatus value is interpreted using these values.
Constant | Value | Description |
---|---|---|
SQLDMOJobExecution_BetweenRetries | 3 | Job is waiting on a job step retry attempt. |
SQLDMOJobExecution_Executing | 1 | Job is executing. |
SQLDMOJobExecution_Idle | 4 | Job is idle, awaiting its next scheduled execution. |
SQLDMOJobExecution_PerformingCompletionActions | 7 | All executable job steps complete. Job history logging in progress. |
SQLDMOJobExecution_Suspended | 5 | Job is suspended. |
SQLDMOJobExecution_Unknown | 0 | State cannot be determined. |
SQLDMOJobExecution_WaitingForStepToFinish | 6 | Job is waiting on the outcome of a step. |
SQLDMOJobExecution_WaitingForWorkerThread | 2 | Job is blocked, unable to obtain a thread resource. |