Creating Job Steps

Administering SQL Server

Administering SQL Server

Creating Job Steps

A job step is an action that the job takes on a database or a server. Every job must have at least one job step. Job steps can be operating system commands, Transact-SQL statements, Microsoft® ActiveX® scripts, or replication tasks.

CmdExec Job Steps

CmdExec job steps are operating system commands or executable programs ending with .bat, .cmd, .com, or .exe.

When you create a CmdExec job step, you must specify:

  • The process exit code returned if the command was successful.

  • The CmdExec command (for example,
    C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Osql.exe\E\Q "sp_who").

  • A full path to all executables.

To create a CmdExec job step