Foreach loop with Script Task

  • Greetings,

    I have a foreach loop that is fed from a query. This consultation has a single field named "ID" and resulset type of object it returns is called DATA.

    Within the foreach loop desire to manipulate the ID, using VBSCRIPT to this task from a script. How can I set this? How can I manipulate the resultset inside the loop?

    Public Sub Main ()

    '

    'Add your code here

    '

    Dts.TaskResult = Dts.Results.Success

    ¿¿¿MsgBox (Dts.Variables (0). Value)?

    End Sub

    Thanks !!!

  • Create a variable in your package (intID)

    In your script

    Dts.Variables("intID").Value = Cint(Dts.Variables("intID").Value) + 1 ' or however else you want to manipulate it.

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

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