bendataclear
bendataclear

Reputation: 3850

variable stuck in SSIS package

I am writing my first SSIS package to translate data from an SQL View to a flat text file.

The flat text filename needs to be in the date format "[year][month][day][hour][minute][second][ms].txt".

I have added a script component to generate this name which stores it to a variable @[User::Filename] correctly.

SSIS Property Window

Somehow during fiddling with the Script Task the ReadWriteVariables property has been set to the result of the Script (eg. "20130524140500297").

Property Window

I have tried removing this setting in the property window of the Task and by editing the task:

Edit task window

This seems to 'take' but when I build the package the setting magically reverts to the useless number!

Is there something I am missing or any way to remove this permanently? I don't want to revert the file to an earlier version.

Upvotes: 3

Views: 652

Answers (1)

AdamL
AdamL

Reputation: 13161

Yes, you're missing the fact, that ReadWriteVariables property in Script Component should have a list of variables that you want to modify in your script. You however set it to evaluate as expression :). To correct this, set ReadWriteVariables to @[User::Filename], mark EvaluateAsExpression property of @[User::Filename], and set the expression to the variable, not the script.

edit: evaluate variable as expression location:

enter image description here

Upvotes: 3

Related Questions