Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Executing a different step based on a result

Author  Topic 

Yukon2005
Starting Member

8 Posts

Posted - 2006-02-28 : 06:37:04
Hi,

I have a couple of steps in my import dts

------->[step5]<-----
^ ^
[step1] -> [step2] -> [step3] -> [step4]


Step1: Assign gvValidationResult a value of 0 or 1. 0=success 1=failure

Step2: Validate "gvValidationResult" value. If 0 continue to step3 else continue to step5

Step3: Assign gvValidationResult a value of 0 or 1. 0=success 1=failure

Step4: Validate "gvValidationResult" value. If 0 continue to step5.

etc...

Well, that's what I am attempting to do with the below code in step2 and step4.



Option Explicit

Function Main()
dim pkg
dim stpSucceeded
dim stpFailed

set pkg = DTSGlobalVariables.Parent
set stpSucceeded = pkg.Steps("step3")
set stpFailed = pkg.Steps("step5")

if DTSGlobalVariables("gvValidationResult").Value = 0 then
stpSucceeded.DisableStep = False
stpFailed.DisableStep = True
else
stpSucceeded.DisableStep =True
stpFailed.DisableStep = False
End if
Main = DTSTaskExecResult_Success
End Function


Yet, step5 never executes no matter what the result.

Can anyone please help me?
   

- Advertisement -