Execution Time Behavior


Variables behave a little differently depending on whether the package is executing. During design time, a variable's type can change; variables can be created, deleted, and renamed; namespaces can be changed; and so on. However, during execution, only the value of the variable can change and the IS runtime does not allow variable creation, deletion, or type change either. The reason for this policy is to make packages more robust and declarative. One of the design guidelines that underlies this decision is that packages should be completed and validated at design time, which makes it easier to detect problems in the package and detect when parts are missing, and so forth.

Of course, variable values can be changed during execution, but not their type. Another way of putting it is variables are type safe during execution. Because the values in variables are often used in expressions or to populate the values of properties on other IS objects and because the properties on those objects are strictly typed, it is dangerous to allow a variable's type to change during package execution. Because assigning a value of a variable with one value type to a property with another type can fail, it is possible to break a well-tested package by simply modifying a package to assign a value of a different type to a variable as it is executing. Therefore, the package prohibits all attempts to assign values to variables that will change the variable type and will emit an error. Whatever type to which they've been configured during design time, variables retain that type during execution.

Variables also cannot hold instances of Integration Services object model objects. For example, a task would not be allowed to set a variable value to point to itself and then later use the Script Task to modify the values of that task. IS variables detect whenever an attempt is made to place an IS object into the value of the variable and will emit an error. The only exception to this rule is Foreach Enumerators. Because of the various ways they can be created and populated, Microsoft felt that there needed to be a little more flexibility in how Foreach Enumerators can be created. This makes certain usage patterns possible; for example, it is possible to populate a ForEachItem Enumerator with a Script Task.



Microsoft SQL Server 2005 Integration Services
Microsoft SQL Server 2005 Integration Services
ISBN: 0672327813
EAN: 2147483647
Year: 2006
Pages: 200
Authors: Kirk Haselden

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net