dbTalk Databases Forums  

Using DTSStepScriptResult_DontExecuteTask to skip a single step

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Using DTSStepScriptResult_DontExecuteTask to skip a single step in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
LP
 
Posts: n/a

Default Using DTSStepScriptResult_DontExecuteTask to skip a single step - 04-05-2005 , 09:25 PM






Hello All,

I have a situation where DTS will need to anticipate an occurance where a
file is not present. I do that just fine but I don't want to skip all the
rest of teh steps in the package. I likely have either other files to load
in or archiving that needs to execute in that package.

The script below was changed from the SQLDTS.com article 211

I thought that if I simply called
"pkg.Steps("DTSStep_DTSActiveScriptTask_5").Execut ionStatus =
DTSStepExecStat_Waiting ", that step would execute and I could skip ove the
step I want to by using "Main = DTSStepScriptResult_DontExecuteTask"


Any help is greatly appreciated.
Function Main()
Dim pkg, oFSO, sFileName
'STOP
set pkg = DTSGlobalVariables.Parent
' Get the name of the file from the global variable "FullPath"
sFileName = DTSGlobalVariables("FullPath").Value
msgbox(sFileName)
Set oFSO = CreateObject("Scripting.FileSystemObject")

' Check for file and return appropriate result
If not oFSO.FileExists(sFileName) Then
'set file = oFSO.GetFile(sFileName)
'If file.Size = 0 Then
msgbox "Missing File " '& sFileName.size & " bytes"
pkg.Steps("DTSStep_DTSActiveScriptTask_5").Executi onStatus =
DTSStepExecStat_Waiting
msgbox"I executed move to history"
pkg.Steps("DTSStep_DTSCreateProcessTask_1").Execut ionStatus =
DTSStepExecStat_Waiting
msgbox"I executed Zipit"
Main = DTSStepScriptResult_DontExecuteTask

ELSE
msgbox "File size is " '& sFileName.size & " bytes"
Main = DTSStepScriptResult_ExecuteTask
End if

Set oFSO = Nothing
End Function


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.