DeleteLevel Property (SQL-DMO)

The DeleteLevel property controls post-execution processing for SQL Server Agent jobs.

Applies To

Job Object

Syntax

object.DeleteLevel [= value]

Part Description
object Expression that evaluates to an object in the Applies To list
value Long integer specifying a job completion status as described in Settings

Settings
Constant Value Description
SQLDMOComp_All 6 Delete regardless of success or failure.
SQLDMOComp_Always 3 Delete regardless of success or failure.
SQLDMOComp_Failure 2 Delete on failed completion.
SQLDMOComp_None 0 Default. Ignore any completion status. Do not delete.
SQLDMOComp_Success 1 Delete on successful completion.

Remarks

If directed, SQL Server Agent can delete a job definition when execution succeeds or fails. By default, jobs are not deleted when execution completes, regardless of the success or failure of the job.

Set DeleteLevel to control agent deletion of jobs after execution.

Data Type

Long, enumerated

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetDeleteLevel(SQLDMO_COMPLETION_TYPE* pRetVal);

HRESULT SetDeleteLevel(SQLDMO_COMPLETION_TYPE NewValue);

  


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