Output variable from script task to destination

Jay 21 Reputation points
2022-09-28T19:27:12.91+00:00

This must be easy but I can't see how to achieve.
Script task takes the Row.Columnname and concatenates it with an read/write package variable this variable is then incremented by 1 and around we go.
However the destination 9Excel) only contains exactly what came from the source (SQL) and not joined to the variable value.
How do I tell the script to output the new variable value to the destination rather than the original source input?

When I go to the output for the script task I can only seen the column and not the variable

public override void Input0_ProcessInputRow(Input0Buffer Row)
{

    Variables.NewOutput = Row.Addr1 + Variables.i.ToString();  
}
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,452 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 32,821 Reputation points
    2022-09-29T07:36:19.103+00:00

    Hi @Jay ,

    To use a variable in a script, first ensure that the variable has been added to either the list contained in the ReadOnlyVariables property or the list contained in the ReadWriteVariables property of this script task, according to whether or not your code needs to write to the variable.

    You may refer to how-to-access-ssis-package-variables-inside-script-component and ssis-write-to-object-variable-through-script-task for detail information.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments