共用方式為


OnFailStep Property

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

The OnFailStep property identifies the SQL Server Agent job step executed after failure of the referenced step.

語法

object
.OnFailStep [= value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list

  • value
    A long integer that specifies a job step by ordinal number

Data Type

Long

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetOnFailStep(LPLONG pRetVal);
HRESULT SetOnFailStep(long NewValue);

備註

On failure of a job step, SQL Server Agent can stop the job (reporting success or failure), or if the job has more than a single step, it can attempt to execute the next step or another step in the job.

To direct job failure logic to a specific step

  1. Set OnFailStep to indicate the job step that should execute.

  2. Set the OnFailAction property to SQLDMOJobStepAction_/GotoStep.

Applies To: