Skip to main content

SQL Job Actions

For more information on SQL Agent job fields, refer to SQL Job Details in the Concepts online help.

MS SQL DTExec

For more information on the MS SQL DTExec job type, refer to Fields for MS SQL DTExec in the Concepts online help.

The following is an example of how to define a MS SQL DTExec job with FILE as the Connection type:

Defining MS SQL DTExec with FILE Connection

The following is an example of how to define a MS SQL DTExec job with SQL as the Connection type:

Defining MS SQL DTExec with SQL Connection

MS SQL Job

For more information on the MS SQL Job type, refer to Fields for MS SQL Job in the Concepts online help.

The following is an example of how to start a MS SQL Server Agent job and monitor it until completion:

Defining MS SQL Job to Monitor until Completion

The following is an example of a MS SQL Server Agent job to monitor only when the MS SQL Server Agent job is running:

Defining MS SQL Job to Monitor while Job Runs

The following is an example of how to start a MS SQL Server Agent job and monitor it until the specified run time:

Defining MS SQL Job to Monitor with Specified End Time

The following is an example of how to start and monitor a MS SQL Server Agent job with a password overwrite option:

Defining MS SQL Job to Monitor with Password Overwrite Option

MS SQL Script

For more information on the MS SQL Script job type, refer to Fields for MS SQL Script in the Concepts online help.

The following is an example of how to define a MS SQL Script job with In Line Script job details:

Defining MS SQL Script with In Line Script

The following is an example of how to define a MS SQL Script job with In Line Script and Environment Variables:

Defining MS SQL Script with Environment Variables

The following is an example of how to define a MS SQL Script job with In Line Script with Environment Variables:

Defining MS SQL Script with In Line Script and Environment Variables

The following is an example of how to define a MS SQL Script job with a job output file and a password overwrite option:

Defining MS SQL Script with Output File Path and Password Overwrite Option

The following is an example of how to define a MS SQL Script job with Windows Authentication and Script File:

Defining MS SQL Script with Windows Authentication and Script File

MySQL

For more information on the MySQL job type, refer to Fields for MySQL in the Concepts online help.

The following is an example of a MySQL job with a default port:

Defining MySQL with Default Port

The following is an example of a MySQL job with a password overwrite option:

Defining MySQL with Password Overwrite Option

The following is an example of a MySQL job details to use for Environment Variables:

Script File Path: C:\SQLScripts\mysql_insert_params.sql

"Mysql_insert_params.sql" script details:

Insert into address (Lastname, Firstname, Address) values (@LN, @FN, @ADS);

Defining MySQL with Environment Variables

Oracle

For more information on the [Oracle]{.GeneralAgentName(JobType5)} job type, refer to Fields for Oracle in the Concepts online help.

The following is an example of an [Oracle]{.GeneralAgentName(JobType5)} job with an output file path and a password overwrite option:

Defining Oracle with Output File Path and Password Overwrite Option

The following is an example of an [Oracle]{.GeneralAgentName(JobType5)} job with parameters:

Defining Oracle with Parameters

The following is an example of an [Oracle]{.GeneralAgentName(JobType5)} job with encrypted parameters:

Defining Oracle with Encrypted Parameters

The following is an example of an [Oracle]{.GeneralAgentName(JobType5)} job with a Connection ID:

Defining Oracle with Connection ID

Other DB

For more information on the [Other DB]{.GeneralAgentName(JobType6)} job type, refer to Fields for Other DB in the Concepts online help.

The following two examples are of an Other DB job with DSN Name and In Line Script with Environment Variables:

Defining Other DB using DSN Name with In Line Script and Environment Variables 1

Defining Other DB using DSN Name with In Line Script and Environment Variables 2

Defining Other DB using DSN Name with In Line Script and Environment Variables 2

The following is an example of an Other DB job with DSN Name with a password overwrite option:

Defining Other DB using DSN Name with Overwrite Password Option

The following is an example of an Other DB job with an OleDB Connection String:

Defining Other DB using OleDB Connection String with In Line Script

The following two examples are of an Other DB job with an OleDB Connection String with Script File and Environment Variables:

Insert-with-params.sql script file details:

declare @LN varchar(25), @FN varchar(25), @Ads varchar(50), @zip int;

set @LN = $(LN);

set @FN = $(FN);

set @Ads = $(Ads);

set @zip = $(zip);

select * from address where Lastname = @LN;

insert into address values(@LN,@FN,@Ads,@zip);

Defining Other DB using OleDB Connection String with Script File

Defining Other DB using OleDB Connection String with Environment Variables

Defining Other DB using OleDB Connection String with Environment Variables

The following is an example of an Other DB job with an ODBC Connection String with In Line Script:

Defining Other DB using ODBC Connection String with In Line Script

The following is an example of an Other DB job with an ODBC Connection String with In Line Script with Environment Variables:

Defining Other DB using ODBC Connection String with In Line Script and Environment Variables