Compartilhar via


How to: Modify the Properties of a Variable Using the Properties Window

This procedure describes how to modify the properties of a user-defined variable. SQL Server 2005 Integration Services (SSIS) also provides a set of system variables. Their properties cannot be updated.

The Properties window lists properties for configuring variables that are not available in the Variables window: Description, EvaluateAsExpression, Expression, ReadOnly, and ValueType.

The value of a variable can be set by the Value or the Expression property. By default, the EvaluateAsExpression property is set to False and the value of the variable is set by the Value property. To use an expression to set the value, you must first set EvaluateAsExpression to True, and then provide an expression in the Expression property. The Value property is automatically set to the evaluation result of the expression.

The ValueType property contains the data type of the value in the Value property. When Value is set by an expression, ValueType is automatically updated to a data type that is compatible with the evaluation result of the expression. For example, if Value contains 0 and ValueType property contains Int32 and you then set Expression to GETDATE(), Value contains the current date and time and ValueType is set to DateTime.

The Properties window for the variable provides access to the Expression Builder dialog box. You can use this tool to build, validate, and evaluate expressions. For more information, see Expression Builder and Integration Services Expression Reference.

To modify the properties of a variable

  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 View menu, click Properties Window.

  4. In SSIS Designer, click the Package Explorer tab and expand the Package node.

  5. To modify variables with package scope, expand the Variables node; otherwise, expand the Event Handlers or Executables nodes until you locate the Variables node that contains the variable that you want to modify.

  6. Click the variable whose properties you want to modify.

  7. In the Properties window, update the read/write variable properties. Some properties are read/read only for user-defined variables.

    The following table lists variables that may be updatable.

    Read/write property Update action

    Description

    Modify the description.

    EvaluateAsExpression

    Set to True to use the evaluation result of an expression in the Value property.

    Expression

    Click (…) to open the Expression Builder dialog box and build the expression using this graphical tool, or type an expression.

    Name

    For user-defined variables, modify the variable name.

    Namespace

    For user-defined variables, modify the namespace.

    RaiseChangedEvent

    Set to True to raise an event when the variable changes value.

    ReadOnly

    For user-defined variables, set to True to make the variable read/write.

    Value

    For user-defined variables, specify a value. The value must be compatible with value type in the ValueType property.

    ValueType

    For user-defined variables, specify the data type of the variable value.

    Important

    The values of the Name and Namespace properties must begin with an alphabetic character letter as defined by the Unicode Standard 2.0, or an underscore (). Subsequent characters can be letters or numbers as defined in the Unicode Standard 2.0, or the underscore ().

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

See Also

Tasks

Using Variables in Packages
How to: Add a Variable to a Package 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