CurrentExecutionStatus Property

SQL-DMO

SQL-DMO

CurrentExecutionStatus Property

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.

Applies To
JobFilter Object
Syntax

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

Data Type

Long, enumerated

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetCurrentExecutionStatus(
SQLDMO_JOBEXECUTION_STATUS* pRetVal);

HRESULT SetCurrentExecutionStatus(
SQLDMO_JOBEXECUTION_STATUS NewValue);

Settings
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