How can use read and write variable in ssis script

2019-09-11 01:39发布

问题:

I'm new in ssis and want to pass read and write variable to the script component,for that purpose, define variable in script editor windows:

and in the script write this code for use that:

but when run that data flow,i get this error:


How can i solve that problem?search on the web i did not understand anything.thanks all.

回答1:

That means that you can use variables from ReadWriteVariables only at PostExecute method, for example, to save your counter value. If you need to read this variable before PostExecute method, you can specify it as ReadOnlyVariables. Caveat - you can choose only one of the collections, not both. This is by Microsoft design.
If you need to have read access to a read-write variable earlier that PostExecute, you can call VariableDispenser as described here. But in this case you have to exclude this variable from both ReadOnlyVariables and ReadWriteVariables lists.



标签: ssis