The CurrentExecutionStatus property filters jobs listed in the JobServer object EnumJobs method, restricting the returned QueryResults object to list only those jobs whose execution state matches the value set.
object.CurrentExecutionStatus [= value]
object
Expression that evaluates to an object in the Applies To list
value
Specifies a job execution status as described in Settings
Long, enumerated
Read/write
HRESULT GetCurrentExecutionStatus(
SQLDMO_JOBEXECUTION_STATUS* pRetVal);
HRESULT SetCurrentExecutionStatus(
SQLDMO_JOBEXECUTION_STATUS NewValue);
| Constant | Value | Description |
|---|---|---|
| SQLDMOJobExecution_BetweenRetries | 3 | List only jobs waiting for a retry attempt time slice to end |
| SQLDMOJobExecution_Executing | 1 | List only executing jobs |
| SQLDMOJobExecution_Idle | 4 | List only jobs awaiting scheduled execution |
| SQLDMOJobExecution_PerformingCompletionActions | 7 | List only jobs logging job history or performing other cleanup tasks |
| SQLDMOJobExecution_Suspended | 5 | List only suspended jobs |
| SQLDMOJobExecution_Unknown | 0 | Ignore execution status when filtering |
| SQLDMOJobExecution_WaitingForStepToFinish | 6 | List only jobs waiting for a step to finish |
| SQLDMOJobExecution_WaitingForWorkerThread | 2 | List only jobs blocked by waiting for an execution thread resource |