sp_updatetask (version 6.5)

Updates information about a task. The @cmdexecsuccesscode parameter has been added.

For additional syntax information for sp_updatetask, see the Microsoft SQL Server Transact-SQL Reference.

Syntax

sp_updatetask {currentname | id} [, name] [, subsystem] [, server] [, username] [, databasename] [, enabled] [, freqtype] [, freqinterval] [, freqsubtype] [, freqsubinterval] [, freqrelativeinterval] [, freqrecurrencefactor] [, activestartdate] [, activeenddate] [, activestarttimeofday] [, activeendtimeofday] [, nextrundate] [, nextruntime] [, runpriority] [, emailoperatorname] [, retryattempts] [, retrydelay] [, command] [, loghistcompletionlevel] [, emailcompletionlevel] [, description] [, tagadditionalinfo] [, tagobjectid] [, tagobjecttype] [, @cmdexecsuccesscode]

where

@cmdexecsuccesscode
Specifies an int value meaningful only for tasks whose @subsystem is CmdExec. This parameter is used by SQL Executive to determine if the CmdExec task failed or succeeded. If @cmdexecsuccesscode does not match the actual process exit code of the program involved in the task, the task is considered to have failed.