Is there a way to have a loop in a DTS package? Or at least to create a start and an end points? I have this process that I put in a DTS package and the process needs to be executed 13 times (involving the creation of different files based on a list of customers) and everything seems to work when I run it once but if I try to insert an "on success" arrow from the last process back to the begining it starts picking a different start point when I rerun it :( Does this make sense?
Any help would be greatly appreciated ;)
--mikeI'm not positive that this will work, but you can try it:
1. Add a global variable (package properties) called LoopCounter
2. Add an ActiveX script (call it "LoopChecker") BEFORE the DTS task and use it to check the value of LoopCounter. If greater than 13, then fail the task; if less than 13 then succeed the task.
3. Link this new ActiveX script to your existing DTS work path using the Success workflow.
4. Add a second ActiveX script to serve as the terminator for the failed "LoopChecker" task
5. Add a third ActiveX script (called "Loop Increment") to increment the LoopCounter variable AFTER the existing DTS task. Set it's workflow to point to "LoopChecker" on success (or even on completion).
You can probably figure out a way to eliminate one of the ActiveX scripts and combine features.
Best of luck, let us know what works.
Regards,
Hugh Scott
Originally posted by Mickael
Is there a way to have a loop in a DTS package? Or at least to create a start and an end points? I have this process that I put in a DTS package and the process needs to be executed 13 times (involving the creation of different files based on a list of customers) and everything seems to work when I run it once but if I try to insert an "on success" arrow from the last process back to the begining it starts picking a different start point when I rerun it :( Does this make sense?
Any help would be greatly appreciated ;)
--mike|||Thanks for the help. I actually found a solution by using the following activex script
IF DTSGlobalVariables("Counter").Value <= DTSGlobalVariables("MaxCount").Value THEN
Set oPkg = DTSGlobalVariables.Parent
oPkg.Steps("DTSStep_DTSDataPumpTask_1").ExecutionStatus = DTSStepExecStat_Waiting
Main = DTSStepScriptResult_DontExecuteTask
ELSE
Main = DTSStepScriptResult_ExecuteTask
END IF
so if the 'IF' statement is true then it reset the first step of my process to wait status and therefore starts again :)
Thanks again,
Mike
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment