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. |
The agent uses the stored procedure sp_start_job in the database 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.
Tip: You can write a script to retrieve a list of all available MS SQL jobs. For more information, see SQL_GET_JOBS.
Examples
SQL_EXECUTE_JOB JOB="Integrity Checks Job for DB Maintenance Plan";
See also: