SabAlo


In a Data Flow, I have the necessity to use a SSIS variable of type ˇ°Objectˇ± inside Script Component and assign to it the content of 'n' variables of string type.

On exiting from the script the variable of type object should contain something like in the following lines:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBB

CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDDDDDDDD
ˇ­ˇ­ˇ­ˇ­ˇ­ˇ­ˇ­.
ˇ­ˇ­ˇ­ˇ­ˇ­ˇ­ˇ­.

On exiting from the data flow I will use the variable of type Object in a Script Task, by reading each element in a cyclic fashion.

Is there anyone who have experienced something like this Could anyone provide any example of that

Thanks in advance!




Re: Use of a SSIS variable of type ˇ°Objectˇ± inside Script Component and Task Component

Cho Yeung - Microsoft


Inside your script component, you can create an array (or list) and store the value of each of your 'n' variables into the array. You then assign the array to the Object type SSIS variable.

To read from the SSIS variable after exiting dataflow, you can use the 'Foreach loop" container which a standard control flow item. Even if you try to use the script task to read from the ssis variable, getting the element from an array is definitely easier than parsing for the data.

If I haev misunderstood your problem, please clarify. Thanks

Cho






Re: Use of a SSIS variable of type ˇ°Objectˇ± inside Script Component and Task Component

SabAlo

Thank you for the answer and, as you stated, I clarify better the situation where I am at.

Following your suggestion, I assigned to an array, defined inside the script, two values and this is assigned to the SSIS variable on output.

Executing this script in a loop the first time the SISS variable has System.Object type but exiting from the script, after I assign the array to the SiSS var, this one change the type into System.String[ ].

On the next loops I need to append more items into that var, how I have to manage the SISS var

Could you give me a "code hint" (VB.NET)

Thank you!!






Re: Use of a SSIS variable of type ˇ°Objectˇ± inside Script Component and Task Component

Cho Yeung - Microsoft

I don't think I understand what you are trying to archevie. Can you give more information on what you are trying to implement Why are you executing your script in the loop Some sample codes on how you are assigning and retrieving the data from the array will also help.