Sunday 21 October 2018

OnVariableValueChanged event handler in SSIS

This event handler Writes a log entry when the value of variable changes. In other words, we can say that this event is raised by an executable when the value of a variable change. The event is raised by the executable on which the variable is defined.
     
This is the event which gets raised when the value of the variable is changed. But to have this event raised properly for a particular variable; certain points to be kept in mind:
Ø  Property of the variable “RaiseChangeEvent” must be set to “TRUE”. RaiseChangeEvent is a variable property.
            
Ø  When the OnVariableChangedEvent is fired, the event is scoped to the same container that the variable is scoped to. The event is NOT scoped to the container that changed the variable.
Ø  It means that an OnVariableChangedEvent event handler scoped to the container that changed the variable will not get fired unless the variable is scoped to the same.

Also, in case of the variable having the expressions (with EvaluateAsExpression=TRUE), the event would not be raised when the value of the expression will be changed, rather event of its dependent variables will be raised; when the value of the variable on which this expression is dependent; is changed. So to raise the event properly for such variable; the RaiseChangeEvent property for those dependent variables must be set to TRUE and their OnVariableChangedEvent events should be handled.

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts