SSIS Script Component problem

  • Anyone else experienced this or am I doing something wrong??

    I have a SSIS Script Component that has 1 ReadWriteVariable. In the PreExecute sub I use the following to access the ReadWriteVariable

    Dim Vars As IDTSVariables90

    Me.VariableDispenser.LockOneForRead("SeqNo", Vars)

    Me.SequenceNo = CInt(Vars(0).Value)

    Vars.Unlock()

    At the end in the PostExecute sub I want to write back a new value to this variable. I'm trying to use this code

    Dim Var As IDTSVariables90

    Me.VariableDispenser.LockOneForWrite("SeqNo", Var)

    Var(0).Value = 0

    Var.Unlock()

    The problem is this block of code in the PostExecute sub seems to hang the SSIS package. While the component turns green the parent data flow task remains yellow preventing any other tasks from executing. If I comment out this block the entire package completes fine. So I'm guessing the variables are deadlocking between the script and the SSIS engine. Of course this is a guess has no error messages are being thrown up to give me anymore of a clue.

    Any ideas???

  • Try removing the Read/Write variable and running again.

    By explicitly mentioning the variables there, you can access them using the

    dts.variables collection.

    However, as you are using variabledispenser, you can access the variables without adding them to the Read/Write list.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • That works, thanks Phil!!

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

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