The Execute command activity is used to execute SQL commands over an established database connection.
This can range from creating tables, disabling triggers, etc., but it cannot handle query results.
|Table of contents
The Execute command activity can execute commands on a connected database during package execution. This allows you to enable or disable certain options and features of the database automatically during package execution. Disabling triggers and constraints or logging additional information to the database are common uses of this activity
To use it, drag it to an already created Connect to database activity. Enter the name of the created database connection, and define the command text by clicking the field next to it. This will open a Code Editor dialog where you can write and validate your SQL commands before they are executed during package execution.
Additional options, like a CommandType and CommandTimeout can also be set if necessary.
In this example we will use the Execute command activity to create a small table and fill it with some data. We will use a Connect to database activity to create a connection to the database. Once the connection is created, place the Execute command activity inside the Connect to database activity. After setting the name of the connection as BdxDemo to match the created connection name, we can enter the command text by clicking the field next to it.
Figure 1: Code Editor dialog
This opens a separate Code Editor dialog where we can enter our SQL commands. After clicking on the Validate button to make sure the command is valid, the command is finished and ready to be executed when the package starts.
Figure 2: Executing an SQL command in a package
|Text of the database command.
CREATE TABLE DemoTable (ID INT PRIMARY KEY, FirstName VARCHAR(100));
INSERT INTO DemoTable VALUES (1, 'John'), (2, 'Jane'), (3, 'Michael');
|Database command timeout in seconds.
|Type of the database command.
|Database connection used to execute database command.
|Collection of database parameters.
|Use pop-up window to set parameters.
|Display name of the activity in the workflow.
|Contains the masking definition object. It's a part of the masking infrastructure and should be ignored.
BizDataX Documentation © Built by Ekobit. All rights reserved.