setting the value of the package variable

  • I have set a value for 2 package variables through a script task. Now i want to access those variable values in another script task.

    Can i do it directly or there is some other way for doing the same.

    Any suggestions please.

    Thanks

  • you can do this by either adding the variables to the "ReadOnlyVariables" property on the Script tab and then you can access them using the dts object:

    [font="Courier New"]Dts.Variables("variable name").Value[/font] - remember to cast the object to the type you require

    Or, you can lock the variable directly (you don't need to add the variables to the ReadOnlyVariables section for this):

    [font="Courier New"]Dim vars As Variables

    Dts.VariableDispenser.LockOneForRead("variable name", vars)

    Dim variableValue As String = vars(0).Value.ToString

    vars.Unlock()[/font]

    Life: it twists and turns like a twisty turny thing

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

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