DTS Output Variables

  • I'm trying to find out if there's a way to pass some variable values from an inner package to the outer package. It seems you can only pass into the child package, but not the other way around. Is that so?

  • This was removed by the editor as SPAM

  • If the global variable is not working for you, you could set the value into a table, so that the parent package could look up the vlaue there. Does it work for you?

  • Thanks, Kathy. That's a good way to go, especially as the number of my DTS packages grow, it'll be a good idea to implement tables like this. For the problem I have at hand now, which is a dynamic filename output, I'm copying the same logic to the parent DTS. Not the best way to do it, but it does the trick for now.

  • This Activex task script calls a child package, passing it the parent package's Global Variable. This worked. I don't see why you can't reverse the flow and get the child package's global variable in a similar manner. Sorry I don't have to time to try it, but you may want toif you have time. Please replace the userid, password, package name, etc. by the values appropriate to your test.

    '**********************************************************************

    '  Visual Basic ActiveX Script

    '************************************************************************

    Function Main()

     Main = DTSTaskExecResult_Success

     Dim oPkg, oStep

     Dim sServer, sUID, sPWD, iSecurity , sPkgPWD, sPkgName, sErrMsg

     Set oPkg = CreateObject("DTS.Package")

     sServer = "ServerName"

     sUID = "UserID"

     sPWD = "Password"

     iSecurity = 0 'DTSSQLStgFlag_UseTrustedConnection

     sPkgPWD = ""

     sPkgName = "PackageName"

     ' Load Child Package

     oPkg.LoadFromSQLServer sServer, sUID, sPWD, iSecurity , sPkgPWD, "", "", sPkgName

     oPkg.GlobalVariables("InnerVar").Value = DTSGlobalVariables("OuterVar").Value

     oPkg.Execute

     oPkg.Uninitialize

     Set oStep = Nothing

     Set oPkg = Nothing

     Main = DTSTaskExecResult_Success

    End Function

  • Carlos, your theory of reversal proved to be right. It worked. Thanks!

Viewing 6 posts - 1 through 5 (of 5 total)

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