Saving value in a variable

I created a package whose source data looks like this

Code EDate Price

HO 6/20/2015 2.0

HO 6/20/2015 3.1

HO 6/20/2015 4.2

HO 6/20/2015 3.3

CL 6/22/2015 2.5

CL 6/22/2015 3.9

and so on..

I want to store Edate in a variable for a particular Code. How can i do this in SSIS?

var_EDate_HO = 6/20/2015

var_EDate_CL = 6/22/2015

June 26th, 2015 3:34pm

See this article.
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 4:43pm

Do you need then to accumulate them? Or action somehow?

Typically it is a good idea to simply put them into a database table.

One way of doing that is to have the Multicast Transformation split the data into two flows.

One flow will work as is, and the other branch will have one or more Conditional Splits to act on the "particular Code" essentially redirecting to a different destination (the table) from which you can harvest them or process.

The Derived Column transformation does it for a single value in the data pipeline, but fairly limited to what a SSIS expression can do, another option is to use a Script Transformation which also operated like the Derived Column Transformation, but exposes the full power of VB/C#.

June 26th, 2015 4:51pm

Hi SyedF,

According to your description, you want to store particular Edate data in a variable.


Thanks,
Katherine Xiong

Free Windows Admin Tool Kit Click here and download it now
June 29th, 2015 6:00am

There are different Flat File Destination. I want to save the file as HO200615.txt. So i wanted to save these dates in a variable and use it rename the output file.
June 29th, 2015 11:58am

We have to save date based on Code. And each code has different date. So are you saying we have to use n number of Execute SQL to store n number of Edates.
Free Windows Admin Tool Kit Click here and download it now
June 29th, 2015 12:49pm

Noo, you cannot have a dynamic number of Execute SQL Tasks.

You need something to drive the logic which still remains obscure.

What we need to know is if the codes change dynamically, hardcoding is too hard to manage later, and too long to event develop.

Perhaps some processing needs to shift into a database.

June 29th, 2015 9:26pm

No, you cannot have a dynamic number of Execute SQL Tasks.

You need something to drive the logic which still remains obscure.

What we need to know is if the codes change dynamically, hardcoding is too hard to manage later, and too long to even develop.

Perhaps some processing needs to shift into a dat

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2015 1:22am

Yes the codes changes dynamically. The user can add few more codes or remove some of the existing codes.
July 1st, 2015 2:25pm

You should then come up with some logic that allows the codes to be managed ideally by the client in a database. And have some dynamic processing in place.

I at the moment do not see the whole picture of how it is going to be processed and why you need these variables to recommend any particulars.

Free Windows Admin Tool Kit Click here and download it now
July 1st, 2015 8:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics