Compartilhar via


How to: Add a Variable to a Package Using the Variables Window

This procedure describes how to define the scope of a variable, create the variable, and update variable properties.

To add a variable to a package

  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.

See Also

Tasks

Using Variables in Packages
How to: Modify the Properties of a Variable Using the Variables Window
How to: Modify the Properties of a Variable Using the Variables Window
How to: Delete a Variable From a Package Using the Variables Window

Concepts

Integration Services Variables
Variables How-to Topics (SSIS)

Help and Information

Getting SQL Server 2005 Assistance