July 28, 2008 at 3:06 am
The story so far...
I am trying to capture the values of variables at the beginning of a package's execution. I can't use the OnVariableValueChanged event handler due to the way that that event is actually raised.
I want to build a generic solution to be able to log variable values at any point during the package, and I have decided to use a script task to fire the OnInformation event.
The signature of this method is:
Dts.Events.FireOnInformation(informationCode as integer, subComponent as string, description as string, helpFile as string, helpContext as integer, fireAgain as boolean)
My plan was to pass the variable value along to the event handler in the description parameter, and the variable name would go in the subcomponent parameter. The event handler would then pick these up in the System::SourceTask and System::ErrorDescription variables.
However, it doesn't matter what value I put in the subComponent parameter, the SourceTask variable always contains the source task name. In fact, there aren't any variables that contain the value of the subcomponent parameter.
My question is thus: where can I pick up the value passed via the subComponent parameter? And, if it is not possible, what is the point of having it there at all?
Any help would be greatly appreciated as I have been scratching my head over this for a few days, now.
Cheers,
Tom
July 28, 2008 at 6:29 am
July 28, 2008 at 3:12 pm
November 28, 2008 at 6:07 am
Update:
I have been able to solve this (after coming back to it after a little while) by using the dts.Events.FireCustomEvent method.
The method's signature is: eventName as string, eventText as string, byRef arguments() as Object, subComponent as string, byRef fireAgain as boolean
For the event name, use OnVariableValueChanged. The event text can be string.empty. SubComponent can be empty, but I use the name of the task. FireAgain I have set as true.
The arguments parameter needs to be an object array containing the following four items: Variable Name, Variable ID, Variable Description and Variable Value.
You can now fire this event even if the actual event would not get fired (i.e. if a variable is updated by a configuration at the start of the package execution).
Hopefully, this may help someone else who has been scratching their head over this one.
Tom
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply