DTS to run DTS packages

  • I've got about 20 DTS packages that perform various functions (truncate, transfer data, load data, etc)  They are all currently run manually.  I know there has got to be a way to bundle them under a controling dts package so I don't have to rewrite all the code into one package.  A batch process of sorts is what I'm looking for.  Additionally, I tend to be a visual sort, so any example snippit would help.

    Thanks.

  • You just need to create another dts package and use the dts package task. This is the yellow parcel with a blue arrow wrapped around it.

    You can either call the packages at once or step them on success as you would in a normal package.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Wow!  I can't believe it was that simple.   

    Thanks Jonathan.

  • You can also execute a DTS package from within an ActiveX Script...

     

    Function Main()

     

    'Declare variables

      Dim objPkg

     

      'Create and Execute the package

      Set objPkg = CreateObject("DTS.Package")

      objPkg.LoadFromSQLServer _

                "YourServerName", , , _

                DTSSQLStgFlag_UseTrustedConnection,,,, _

                "YourDTSPackageName"

      objPkg.Execute

     

      'Clean-up objects

      Set objPkg = Nothing

     

      Main = DTSTaskExecResult_Success

     

    End Function

     

     

    You could add as many objPkg as needed within the same ActiveX Script to create a simple batch process.

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

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