Automation Engine Script Guide > AE JCL for SQL > SQL_EXECUTE_JOB

SQL_EXECUTE_JOB

Executes a job on the MS SQL Server.

Syntax

SQL_EXECUTE_JOB JOB=...

Syntax

Description/Format

JOB=

Name of the MS SQL job.

Comments

The agent uses the stored procedure sp_start_job in the databaseA database is an organized collection of data including relevant data structures. msdb in order to start the MS SQL jobs.

The status of the AE job depends on the started job's execution:

Status of the MS SQL job

Status of the AE job

MS SQL job has successfully ended

ENDED_OK

MS SQL job has aborted

ENDED_NOT_OK

User has canceled the MS SQL job

ENDED_CANCEL

The AE job also aborts if the user is not authorized or if a database other than Microsoft SQL Server has been used.

The agent calls the stored procedure sp_stop_job if you terminate the AE job while the MS SQL job is still active. In doing so, the MS SQL job does not abort immediately and is monitored until its end has been defined.

The script element SQL_GET_JOBS lists all available MS SQL jobs.

Examples

SQL_EXECUTE_JOB JOB="Integrity Checks Job for DB Maintenance Plan";

 

See also: