SSIS 2008R2 .. Read, transform, write the same user variable.
-
Thursday, February 14, 2013 5:57 PM
In SSIS 2008R2, I have a package why have a Control Flow, with a Script Task declared, which has with 1 ReadOnlyVariables: pReadVar (string), and 1 ReadWriteVariables:pReadWriteVar (string).
The pseudocode of it is like this:
1) I define this auxs variables: xRvar (string) , xRWvar(string)
2) I read the params to set them into the auxs vars defined in step (1). xRvar = pReadVar, xRWvar=pReadWriteVar
3) I excecute some code, which refers to both auxs vars, and lets say that I have to change the content of the aux var, for example, lets set it to xRWvar=xRvar+today.tostring
4) I want to write de output var .. so I try to set pReadWriteVar = xRWvar, ... .. .. but I always get and error of deadlock in the var pReadWriteVar.
How can I get my goal on this need ??
Thanks a lot .. jperez-adium
All Replies
-
Thursday, February 14, 2013 6:13 PM
First of all the syntax for using the SSIS variable in Script task is not appropriate
use Dts.variables["user::variablename"].value.........otherwise beside this you must be assigning some value to the SSIS variable which is not sync with the datatype. if you are still getting error can you elaborate what you are trying to do ?
Please mark it as helpful if it helps.
Thanks
Sumit
-
Thursday, February 14, 2013 7:46 PM
Thanks you for your answer.
I point this things for your knowledge: 1) I wrote the appropriate syntax for that Script task. My post is write as a pseudo-code style. 2) all the variables involved are String datatype, so .. I still has that error. Can you help me ??
-
Friday, February 15, 2013 3:37 AM
Hi,
here is two very good blogs to use ReadWriteVariables :
And one from Jamie
You need to lock the readWrite variables before reading it or writing it.
If it doesnot solve your problem. Can you please post your code ?
Please mark it as helpful if it helps.
Thanks
Sumit
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Monday, February 25, 2013 2:54 AM

