I badly need to insert filename along with data in DTS and am losing the battle

  • I've encountered problems when trying to set variables of a package that I'm executing, wonder if you're having the same problem? There is a problem in DTS that surfaces when dealing with package variables, such that you must delete and then re-add the variables to the package. It looks like you might be having the same problem here.

    You might try, in your Main() code, deleting the sFileName variable from the package, and then re-adding it with code. IIRC, the Package object has a "GlobalVariables" collection with a Remove() method...and there's a AddGlobalVariable() method that lets you re-add a variable back to the collection. Basically, Remove() the variable (by its name) and then just AddGlobalVariable() to put it right back with the value you want.

    Sorry I don't have any more info, but check Books Online for the above methods. I have code but it's in C# so don't know how helpful that'll be.

     

     

  • Thanks. I forgot to delete this from the system, but I solved it.

    oPKG.GlobalVariables("sFilename") worked

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

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