How to: Add or Delete a Variable in a Package by Using the Variables Window

These procedures describe how to add or delete a user-defined variable in a package by using the Variables window.

Integration Services also provides system variables that make system information available at run time and can be used in containers such as packages and event handlers. You cannot delete system variables.

To add a variable to a package by using the Variables window

  1. In Business Intelligence Development Studio, open the Integration Services package you want to work with.

  2. In Solution Explorer, double-click the package to open it.

  3. In SSIS Designer, to define the scope of the variable, do one of the following:

    • To set the scope to the package, click anywhere on the design surface of the Control Flow tab.

    • To set the scope to an event handler, select an executable and an event handler on the design surface of the Event Handler tab.

    • To set the scope to a task or container, on the design surface of the Control Flow tab or the Event Handler tab, click a task or container.

  4. On the SSIS menu, click Variables. You can optionally display the Variables window by mapping the View.Variables command to a key combination of your choosing on the Keyboard page of the Options dialog box.

  5. In the Variables window, click the Add Variable icon. The new variable is added to the list.

  6. Optionally, click the Choose Variable Columns icon, select additional columns to show in the Variables dialog box, and then click OK.

  7. Optionally, update the name, data type, value, and namespace of the variable and indicate whether a change event is raised when the variable value changes.

  8. To save the updated package, click Save Selected Items on the File menu.

To delete a variable from a package by using the Variables window

  1. In Business Intelligence Development Studio, open the Integration Services project that contains the package you want.

  2. In Solution Explorer, right-click the package to open it.

  3. On the SSIS menu, click Variables. You can optionally display the Variables window by mapping the View.Variables command to a key combination of your choosing on the Keyboard page of the Options dialog box.

  4. In the Variables window, click Show All Variables.

  5. Select the variable to delete, and then click Delete Variable.

  6. If the Confirm Deletion of Variables dialog box opens, click Yes to confirm.

  7. To save the updated package, click Save Selected Items on the File menu.