Define package variables in Script component and use them in another script component in SSIS

38 views Asked by At

I use SSIS to work on a project where I use xml files. So I'm in an SSIS data flow. In a first script component, I perform actions on the xml (I take the first line and the last one and perform actions). Depending on what I receive, I'd like to change the value of some package variables. To do this, in the PostExecute() of my first script component, I do the following

Variable.myVariable = myLocalVariable;
MessageBox.Show(Variable.myVariable);

(By the way, I don't know if this is important or not, it's in the Input0_ProcessInput(Input0Buffer Buffer) function that I add lines to my OutputBuffer).

Afterwards, the variables I've just defined in this first C# script component, I'd like to use in a second script component later on. However, when I try to retrieve the values of the package variables initialized in the PostExecute() of the first script component, I only have the default values of the variables I set when I created them.

How and at where can I retrieve my variables initialized in the first PostExecute() in my second script component ? Secondly, why is it that when I put a MessageBox.Show("string") in my PostExecute(), the message isn't displayed, whereas elsewhere in the script it is?

0

There are 0 answers