June 6, 2007 at 4:26 pm
I have DTS's that use activex scripts to succeed or fail in order to terminate the DTS without proceeding to the next step. It is so annoying that the job step reports failure because of this.
June 7, 2007 at 8:25 am
Instead of failing the step use activex to diable the steps you don't want to execute.
Here is an example.
sub chkfiles(flnm,tsk)
set fso=createobject("scripting.filesystemobject")
if fso.fileexists (flnm) then
DTSGlobalVariables.Parent.Steps("DTSStep_DTSDataPumpTask_"&tsk).DisableStep = False
setprec "DTSStep_DTSExecuteSQLTask_2","DTSStep_DTSDataPumpTask_"&tsk
else
DTSGlobalVariables.Parent.Steps("DTSStep_DTSDataPumpTask_"&tsk).DisableStep = True
end if
end sub
June 7, 2007 at 8:37 am
Thank you for the quick reply, I was looking at that property and wasn't exactly sure how to use it. I am going to test this today. I want to see if the DTS will exit if the step(s) are reached but set "disabled."
June 7, 2007 at 8:45 am
June 7, 2007 at 8:45 am
what does this do?
setprec "DTSStep_DTSExecuteSQLTask_2","DTSStep_DTSDataPumpTask_"&tsk
June 7, 2007 at 9:05 am
That is a sub I use to set step precedence so that future steps will run if I disable a middle step. I have 50 files that come in and get processed but if only some come in I still want the processing to run after all of the available files have imported. This sets a success precedent for each file that arrives so the processing waits for all of the imports to happen. If you use this make sure you clear all of the precedence off of the step and then use this to set the ones you need.
--remove precedence
do While DTSGlobalVariables.Parent.Steps("DTSStep_DTSExecuteSQLTask_2").PrecedenceConstraints.count > 0
DTSGlobalVariables.Parent.Steps("DTSStep_DTSExecuteSQLTask_2").PrecedenceConstraints.remove 1
loop
--set precedence
sub setprec(dest,src)
Set oPkg = DTSGlobalVariables.Parent
Set Destination = oPkg.Steps (cstr(dest))
Set Source = oPkg.Steps (cstr(src))
Set Prec = Destination.PrecedenceConstraints.New(Source.name)
Prec.PrecedenceBasis = DTSStepPrecedenceBasis_ExecResult
Prec.value = DTSStepExecResult_Success
Destination.PrecedenceConstraints.Add Prec
Destination.DisableStep = False
end sub
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply