![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there any way, without using SQL Agent, to run dts's asyncronously? I have 12 dts's - based on regional info, depending on several factors I need to run any number of them, via a gui front-end, where a user selects which of the 'regions' to process. I don't know how to process them one at a time. I am unable to put them into a Job, as all 12 may not be run at the same time, and there's no particular defined number that could be run... Any ideas would be much appreciated? |
#3
| |||
| |||
|
|
One way to do it would be to make EACH of them a job, and then use the gui to start whichever jobs are necessary (depending on what your user selects). Another way to do it would be to have a "master" DTS job that uses global variables in an ActiveX script to fire off whichever (of the 12 regional packages) need to be run. Those global variables could then be set by the gui as the user selects the desired regions, with a final button to run the master DTS job. There are other ways, such as using a stored procedure, or putting all the DTS packages in a chain and then letting each regional "step" determine whether it should run via a global variable, but at any rate, best of luck. "Ben W" <benwatt26 (AT) yahoo (DOT) com.delete> wrote in message news:upD8KcjRDHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Is there any way, without using SQL Agent, to run dts's asyncronously? I have 12 dts's - based on regional info, depending on several factors I need to run any number of them, via a gui front-end, where a user selects which of the 'regions' to process. I don't know how to process them one at a time. I am unable to put them into a Job, as all 12 may not be run at the same time, and there's no particular defined number that could be run... Any ideas would be much appreciated? |
#4
| |||
| |||
|
|
Ah, good point. You want them to run consecutively. I suppose I should have seen that from the title ![]() Ok, here are a few approaches. 1) As you said, you can use the GUI to see which text files exist, then set up a little stringlist for each DTS job that will be needed, then do dtsrun for each of those. You would have to program your GUI to wait for each DTS job to finish, as Allan alludes to when he mentioned the object model. 2) Set up a loop in DTS. Here's an example (by Darren Green) on which you can build: http://www.databasejournal.com/featu...le.php/1461661. For your needs you would probably have that first ActiveX task determine the country-package based on the textfile's name, and then store that (country-package name) in *this* package's GlobalVariables. You would also need a DynamicProperties task, and an ExecutePackage task. The DynamicProperties task would set the ExecutePackage task's PackageName based on what file was up next for importing (by pulling it from GlobalVariables). You may also want an ActiveX script task near the end to delete the text file once you've imported it. In other words, you'll have one DTS package per country, plus this "master" package which will loop around to get the name of the next text file, choose the appropriate country-package to run, execute that package (by setting it's name into the ExecutePackage task using the DynamicProperties task), and then deleting the text file (of course, you've stored it elsewhere for long-term safekeeping). Everything runs consecutively, and only for those files which exist. Best regards. |
![]() |
| Thread Tools | |
| Display Modes | |
| |