CurrentRunStatus Property (SQL-DMO)

The CurrentRunStatus property returns the executing state of a SQL Server Agent job.

Applies To

Job Object

Syntax

object.CurrentRunStatus

Part Description
object Expression that evaluates to an object in the Applies To list

Returns

The CurrentRunStatus value is interpreted by 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 have completed. Job history logging is being performed.
SQLDMOJobExecution_Suspended 5 Job has been 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.

Data Type

Long, enumerated.

Modifiable

Read-only

Prototype (C/C++)

HRESULT GetCurrentRunStatus(
SQLDMO_JOBEXECUTION_STATUS* pRetVal);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.