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)
 DTS Step.ExecutionResult

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-26 : 09:28:53
Eddie writes "SQL Server 2000

I have a need to conditionally execute steps some of the steps in a DTS package, e.g. skip processing steps when no input files are present.

The steps are a combination of ActiveX and DataPumps. I used to use Step.DisableStep, but this required messing with the precedence constraints for further steps.

I have recently tried setting Step.ExecutionResult to DTSStepExecStat_Completed. This causes the step to be bypassed while still maintaining precedence constraints. The problem with this is while the DTS pagkage runs fine stand-alone and reports a success, when I run it in a multi-step job, the step returns an exit code of 5 when the DTS steps are skipped and 0 when not skipped (the log shows the steps have failed). This causes the job step to think it died, causing the job to terminate. I really do want the job to terminate when I have a 'real' error.

According to Microsoft doco Step.ExecutionResult is read only, but the object does in fact let me set this property. The Step.ExecutionResult property is also marked read only and in fact appears to be read only since I can not set its value to DTSStepExecResult_Success.

I guess the question is: is there a way to force the DTS package to return a 0 under my control.

Thanks,

Eddie"
   

- Advertisement -