Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS Variable not changing with Script task

$
0
0

Hi

I have a written a script component to only read in the first row of a flat file and read one of the column values into a variable called MyVariable.

The following is my PostExecute method in the script task:

public override void PostExecute()
    {
        base.PreExecute();
        this.Variables.MyVariable= "MyTestValue";
    }

Now I am using SSIS 2012 so I am able to set a breakpoint on

this.Variables.MyVariable= "MyTestValue";

and when debugging I can see that MyVariable has been assigned the "MyTestValue" value.

However, when executing the package the variable does not seem to change.

If I use a derived column directly after the script component with the expression:

@[User::MyVariable]

nothing is returned.

Can anyone tell me why the variable value in the package is not updating, but it is when debugging the script?

This is the first time I've used variables so I've probably missed something really obvious.


Viewing all articles
Browse latest Browse all 24688

Trending Articles