Store value in SSIS variable, script component

  • Hi,

    I am using a script component.

    From one of the records in the excel, I can get the Date which I have to insert in all the records at the destination.

    The value pops up correctly in the message box, however it is not being stored in the SSIS variable which is to be re-used later.

    Any help or any other idea of achieving the same is most welcome.

    The following is the script:

    Me.VariableDispenser.LockForWrite("User::AOMDate")

    Me.VariableDispenser.GetVariables(vars)

    ActualDate = Convert.ToDateTime(DateRange.Trim.Substring(0, DateRange.IndexOf("-")))

    vars("AOMDate").Value = ActualDate.ToString("MM-dd-yyyy")

    MsgBox(vars.Item("User::AOMDate").Value)

    vars.Unlock()

    Thank you.

  • Although I'm not sure this is relavent..

    Perhaps:

    vars("AOMDate").Value = ActualDate.ToString("MM-dd-yyyy")

    Should be:

    vars("User::AOMDate").Value = ActualDate.ToString("MM-dd-yyyy")

    I can't remember if it cares..

    CEWII

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply