Follow-On Topics

Related Topics

# Adding a Microsoft SQL Server Trigger Task Step

The Microsoft SQL Server Trigger step triggers a task to run when a specific table in an SQL database is updated or deleted, or has a new row inserted.

In addition, global variables created for the task can be mapped to a specific column in the selected table, so that the column value may be used in other steps.

To add a new Microsoft SQL Server Trigger step to an existing task, do the following:

1. Open the relevant task (for creating new tasks, see Creating a New Task).
2. Either:

|  | Click and drag the Microsoft SQL Server Trigger icon from the Task Browser to the task Design area.

|  | Click on the Environment tab in the Task Browser. Right-click on Steps and select New > Event > Microsoft SQL Server Trigger.

|  | From the task's Design tab, right-click on empty space and select New > Event > Microsoft SQL Server Trigger.

3. Enter a Name and Description for the step.
4. Select the Main tab and then select a server from the drop down list.

   NOTE:

   The SQL Server Trigger Agent must be installed on the target SQL Server machine for it to be exposed for selection in the drop down list.

5. Enter the credentials necessary to access the selected server, or select Use Trusted Connection.
6. Click on the Browse to open the SQL Server Browser dialog box. Select a database and table or view, and click OK .
7. Select a Trigger Order option and then go to the Trigger tab.
8. Select the Configure tab and then complete all configuration. If you are running multiple tasks for each row in a result set, columns can be mapped to the task variables which are automatically exposed in the Map Columns to Task Parameters table.
   1. Alternatively, select the Script tab, then click Edit to create the VBScript for the trigger. Note that this option disables the Trigger tab, and all subsequent edits must be done using VBScript.
9. Click OK to save the new Microsoft SQL Server Trigger step and close the dialog box. An icon for the Step is displayed on the Task Plan.
10. Click and drag the Microsoft SQL Server Trigger icon onto the first step in the task.
11. Click OK to save the changes and close the task dialog box.

Copyright © 2018 Quadrant Software B.V. All rights reserved.