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. |