DTS Package execution

  • I have created a DTS package to pump data into visual foxpro tables. I execute this package through a vb com server in a stored procedure where I modify the package's tasks (3 pumps, 1 SQL task and 1 ActiveX script) based on different criteria. This is a process that enters orders from the web. I want to do the same thing for a quick books order system but I would rather not maintain 2 separate DTS packages that perform the same function the only difference being the source database. I know I can write the code to control the vb com server based on the source database, my worry is will there be a problem if both databases try to execute the package simultaneously. Any thoughts would be greatly appreciated.

  • I have run DTS packages simultaneous before and have seeen no issues, however the datasource was not changed so I cannot be sure what the side effect is, I believe it woks like VB coding taht each copy runs in it's own space in memory and does not effect the other unless they lock a common source of data. Best bet is to test and see the results first hand before you implement.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Don't think you should have an issue. I have pacakges that run multiple copies of themselves and I code to prevent it, but they both work.

    Steve Jones

    steve@dkranch.net

  • I think you're both right. When I use the dts.package2 method LoadFromSQLServer it seems to create the package object in its own apartment and should run independent of the stored package info. Like you said though, I'm gonna test the livin' daylights out of it. Thanks to you both.

  • Let us know if any issues come up for future reference.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • I have discovered one thing. If you're going to execute a package from vb, you need to make sure you set the property ExecuteInMainThread to True (the equivalent of setting the workflow property option "Execute on main package thread").

    The reason is because DTS package execution is free threaded but vb is apartment threaded.

    It's easy to do in vb...

    For Each oStep in MyPackage.Steps

    oStep.ExecuteInMainThread = True

    Next

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

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