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
In Business Intelligence Development Studio, open the Integration Services package you want to work with.
In Solution Explorer, double-click the package to open it.
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.
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.
In the Variables window, click the Add Variable icon. The new variable is added to the list.
Optionally, click the Choose Variable Columns icon, select additional columns to show in the Variables dialog box, and then click OK.
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.
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
In Business Intelligence Development Studio, open the Integration Services project that contains the package you want.
In Solution Explorer, right-click the package to open it.
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.
In the Variables window, click Show All Variables.
Select the variable to delete, and then click Delete Variable.
If the Confirm Deletion of Variables dialog box opens, click Yes to confirm.
To save the updated package, click Save Selected Items on the File menu.