dbTalk Databases Forums  

Skip Task with n precedents

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


Discuss Skip Task with n precedents in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
icebold54@hotmail.com
 
Posts: n/a

Default Skip Task with n precedents - 06-03-2005 , 03:57 AM






Hello to everybody,


Using the information kindly provided in this link,
http://www.sqldts.com/default.aspx?214
I can write an ActiveX to edit the workflow of the DTS so that I'm able
to skip tasks.
This works great when there's a relation 1:1 or 1:n between the
precedent task (the skipped one)and the following task (the one I want
to be executed).

Unfortunately I'm not able to make it work properly when the relation
is n:1 given that in this case not only do I skip the 'n' tasks but I
also skip the '1' task (which I want to be executed).

My DTS is something like this:

[ActiveX to set workflow] -> [n connections that read from .txt files]
-> [n Data Transform Tasks] -> [Execute SQL Task]

*) There's one DataTransform Task for each task that read from a .txt
file.
*) I want to skip these DataTransform Tasks in some cases.
*) All the n connections to a .txt file are joined to the ActiveX task
that sets the workflow.
*) All the n DataTransform Tasks are joined to the Execute SQL Task
which I want to execute.

If you want to have a global idea about how this DTS looks like imagine
electric force field lines between a + and a - charge where the + and
- charges are the ActiveX and the SQL Task.

For each DataTransform Task, I edit its ActiveX workflow script with
this code:


Function Main()

Dim oPkg, oStep
Set oPkg = DTSGlobalVariables.Parent

Set oStep = oPkg.Steps("DTSStep_DTSExecuteSQLTask_2")


If DTSGlobalVariables("Increment").Value = 1 Then

' - Execution status of inactive
oStep.PrecedenceConstraints(1).PrecedenceBasis =
DTSStepPrecedenceBasis_ExecStatus
oStep.PrecedenceConstraints(1).Value =
DTSStepExecStat_Inactive

Main = DTSStepScriptResult_DontExecuteTask
Else

' - Execution result of success
oStep.PrecedenceConstraints(1).PrecedenceBasis =
DTSStepPrecedenceBasis_ExecResult
oStep.PrecedenceConstraints(1).Value = DTSStepExecResult_Success

Main = DTSStepScriptResult_ExecuteTask
End If

Set oStep = Nothing
End Function

The workflow line that connects the "Execute SQL Task" with the
"Microsoft Ole DB Provider for SQL Server" (the sink of the
DataTransformTasks) defines the precedences for all the n previous
tasks as 'Correct'




Can anybody help me?


Greetings,
David Grant


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.