dbTalk Databases Forums  

how to skip several SQLExecuteTasks

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


Discuss how to skip several SQLExecuteTasks in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hans [DiaGraphIT]
 
Posts: n/a

Default how to skip several SQLExecuteTasks - 11-17-2005 , 08:29 AM






Hi!

Forgive me for my ignorance.

Iv'e been looking at following webpage But I can't figure out how to skip
SEVERAL steps/tasks in a workflow. (
http://www.sqldts.com/default.aspx?214,1 )

I have following workflow series
Step 1: DTSStep_ActiveScriptTask_1
Step 2: DTSStep_SQLExecuteSQLTask_2
Step 3: DTSStep_SQLExecuteSQLTask_4
Step 4: DTSStep_SQLExecuteSQLTask_5
Step 5: DTSStep_SQLExecuteSQLTask_1
Step 6: DTSStep_SQLExecuteSQLTask_6
Step 7: DTSStep_DTSDataPumpTask_1
Step 8: DTSStep_DTSDataPumpTask_2
....
Step ...: DTSStep_DTSDataPumpTask_...
....
Step x: DTSStep_SQLExecuteSQLTask_3

I wish to skip step 2, 3 and 4 if a global variable is set to true. Is
following code enough, or what am i missing?

Function Main ()
Dim oPkg, oStep

' Get the FinalTask Step
Set oPkg = DTSGlobalVariables.Parent
Set oStep = oPkg.Steps("DTSStep_SQLExecuteSQLTask_1")

If DTSGlobalVariables("MyChoice").Value
Then oStep.PrecedenceConstraints(1).PrecedenceBasis = _
DTSStepPrecedenceBasis_ExecStatus
oStep.PrecedenceConstraints(1).Value = _
DTSStepExecStat_Inactive
oStep.PrecedenceConstraints(2).Value = _
DTSStepExecStat_Inactive
oStep.PrecedenceConstraints(3).Value = _
DTSStepExecStat_Inactive
Main = DTSStepScriptResult_DontExecuteTask
Else
oStep.PrecedenceConstraints(1).PrecedenceBasis = _
DTSStepPrecedenceBasis_ExecResult
oStep.PrecedenceConstraints(1).Value = _
DTSStepExecResult_Success
Main = DTSStepScriptResult_ExecuteTask
End If

Set oPkg = Nothing
Set oStep = Nothing

End Function


greatful for any help.

---------------
Best regards
- Hans -
---------------
(Have fun programming with ... C#)

Reply With Quote
  #2  
Old   
michael v
 
Posts: n/a

Default Re: how to skip several SQLExecuteTasks - 11-18-2005 , 06:02 AM






perhaps this one...

http://www.sqldts.com/default.aspx?218

"Hans [DiaGraphIT]" <hans.arsjo (AT) sshf (DOT) no> wrote

Quote:
Hi!

Forgive me for my ignorance.

Iv'e been looking at following webpage But I can't figure out how to skip
SEVERAL steps/tasks in a workflow. (
http://www.sqldts.com/default.aspx?214,1 )

I have following workflow series
Step 1: DTSStep_ActiveScriptTask_1
Step 2: DTSStep_SQLExecuteSQLTask_2
Step 3: DTSStep_SQLExecuteSQLTask_4
Step 4: DTSStep_SQLExecuteSQLTask_5
Step 5: DTSStep_SQLExecuteSQLTask_1
Step 6: DTSStep_SQLExecuteSQLTask_6
Step 7: DTSStep_DTSDataPumpTask_1
Step 8: DTSStep_DTSDataPumpTask_2
...
Step ...: DTSStep_DTSDataPumpTask_...
...
Step x: DTSStep_SQLExecuteSQLTask_3

I wish to skip step 2, 3 and 4 if a global variable is set to true. Is
following code enough, or what am i missing?

Function Main ()
Dim oPkg, oStep

' Get the FinalTask Step
Set oPkg = DTSGlobalVariables.Parent
Set oStep = oPkg.Steps("DTSStep_SQLExecuteSQLTask_1")

If DTSGlobalVariables("MyChoice").Value
Then oStep.PrecedenceConstraints(1).PrecedenceBasis = _
DTSStepPrecedenceBasis_ExecStatus
oStep.PrecedenceConstraints(1).Value = _
DTSStepExecStat_Inactive
oStep.PrecedenceConstraints(2).Value = _
DTSStepExecStat_Inactive
oStep.PrecedenceConstraints(3).Value = _
DTSStepExecStat_Inactive
Main = DTSStepScriptResult_DontExecuteTask
Else
oStep.PrecedenceConstraints(1).PrecedenceBasis = _
DTSStepPrecedenceBasis_ExecResult
oStep.PrecedenceConstraints(1).Value = _
DTSStepExecResult_Success
Main = DTSStepScriptResult_ExecuteTask
End If

Set oPkg = Nothing
Set oStep = Nothing

End Function


greatful for any help.

---------------
Best regards
- Hans -
---------------
(Have fun programming with ... C#)



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.