Re: Looping in MS SQL 2000 DTS
- From: "Leo Matter" <leo@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 16 Jul 2005 17:11:21 +0200
i think this behaviour and your code is correct, only the flag does not
change
if the falg does not change during execution, it returns an error
i the flag changes, it executes successfully
in this example the flag changes:
flag = 0
'Code to populat Flag with appropriate value
DTSGlobalVariables("counter").Value = _
DTSGlobalVariables("counter").Value + 1
Dim oPkg
If DTSGlobalVariables("counter").Value < 90 THEN
Set oPkg = DTSGlobalVariables.Parent
if DTSGlobalVariables("counter").Value = 56 then
flag = 1
end if
If Flag <> 1 Then
Main = DTSStepScriptResult_ExecuteTask
Else ' flag = 1
'Set oPkg = DTSGlobalVariables.Parent
'Set previous step status to waiting.
oPkg.Steps("DTSStep_DTSActiveScriptTask_1").ExecutionStatus = _
DTSStepExecStat_Waiting
'Do not execute task 2, step 1 will restart.
Main = DTSStepScriptResult_DontExecuteTask
End if
Else ' counter > 90
'Main = DTSTaskExecResult_Failure
End if
set oPkg = Nothing
End Function
'#####
' here the flag does not change, it retries 90 times, and then goes on to
the next task
flag = 0
'Code to populat Flag with appropriate value
DTSGlobalVariables("counter").Value = _
DTSGlobalVariables("counter").Value + 1
Dim oPkg
If DTSGlobalVariables("counter").Value < 90 THEN
Set oPkg = DTSGlobalVariables.Parent
If Flag <> 1 Then
Main = DTSStepScriptResult_ExecuteTask
Else ' flag = 1
'Set oPkg = DTSGlobalVariables.Parent
'Set previous step status to waiting.
oPkg.Steps("DTSStep_DTSActiveScriptTask_1").ExecutionStatus = _
DTSStepExecStat_Waiting
'Do not execute task 2, step 1 will restart.
Main = DTSStepScriptResult_DontExecuteTask
End if
Else ' counter > 90
Main = DTSStepScriptResult_ExecuteTask
'Main = DTSTaskExecResult_Failure
End if
set oPkg = Nothing
End Function
however, i do not really understand what you are trying to do. looping 90
times trough that should not really be a replacement for sleep.
if you want to make the system wait a few seconds, the easiest way is to
insert a SQL task inbetween the two activeX tasks you have and insert this
SQL statement:
WAITFOR DELAY '000:01:00'
each loop will then take one minute
perhaps you could describe in more detail what you are trying to do..
rgds
Leo
<GajanRaj@xxxxxxxxx> wrote in message
news:1120637010.607062.224090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Any suggetions?
>
.
- References:
- Looping in MS SQL 2000 DTS
- From: GajanRaj
- Re: Looping in MS SQL 2000 DTS
- From: GajanRaj
- Looping in MS SQL 2000 DTS
- Prev by Date: Re: Schedule a DTS package
- Next by Date: Re: Opening DTS package from .dts file and Error - Type Mismatch
- Previous by thread: Re: Looping in MS SQL 2000 DTS
- Next by thread: Import files - ftp download
- Index(es):
Relevant Pages
|