DTS Package Properties: Global Variables

  • i'v added a Global Variable to the DTS Package..

    in a ActiveX Script i have this:

    DTSGlobalVariables("counter").value = DTSGlobalVariables("counter").value + 1

    this works fine when i hit execute in the DTS .. but when i run the job in: Local Packages or SQL Server Agent/Jobs .. the Variable counter will stick the the same number..

    strange .. when i close the DTS .. and hit Execute package .. the counter is raised .. but the second time the numbers keeps the same ..

  • Do you mean execute the package twice? The variables don't maintain from execution to execution.

  • yes .... i want to run a package every day .. that packages uses a Global Variables. Every time the packages runs .. the packages needs a +1 on the Global Variables each time the packages runs .. like a counter ..

  • Hi,

    Maybe you can check this approach.

    Have a sql table where you can store the last value and get the value from there using a dynamic properties task or from withing the activex script task and assign it to the global variable.

    Regards,

    Srira

    Sriram

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

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