0

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?

Dexter
  • 21
  • 3
  • Store the values in the database with first script and then query the value from database in second script. – jdweng Aug 18 '23 at 12:15
  • You can use the same child package which is executed from a parent package that passes the variable value. https://www.mssqltips.com/sqlservertip/6089/pass-ssis-variable-from-parent-to-child-package-in-sql-server-integration-services/ – Nicolaesse Aug 18 '23 at 12:24

0 Answers0