共用方式為


CurrentExecutionStatus Property

未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。

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]

Parts

  • object
    An 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

Lists only jobs waiting for a retry attempt time slice to end.

SQLDMOJobExecution_/Executing

1

Lists only executing jobs.

SQLDMOJobExecution_Idle

4

Lists only jobs awaiting scheduled execution.

SQLDMOJobExecution_/PerformingCompletionActions

7

Lists only jobs logging job history or performing other cleanup tasks.

SQLDMOJobExecution_/Suspended

5

Lists only suspended jobs.

SQLDMOJobExecution_Unknown

0

Ignores execution status when filtering.

SQLDMOJobExecution_/WaitingForStepToFinish

6

Lists only jobs that are waiting for a step to finish.

SQLDMOJobExecution_/WaitingForWorkerThread

2

Lists only jobs blocked because they are waiting for an execution thread resource.

Applies To: