Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Conditional Flow in DTS


Conditional Flow in DTS

Author
Message
Wayne-153714
Wayne-153714
SSC-Enthusiastic
SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)

Group: General Forum Members
Points: 146 Visits: 91
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/WFillis/2929.asp


When in doubt - test, test, test!

Wayne

Michael Lysons
Michael Lysons
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1260 Visits: 1394

I'm still in shock from the fact that I've only just found out you can do this!

Nice one - you've made my day


mrpolecat
mrpolecat
SSC-Addicted
SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)SSC-Addicted (452 reputation)

Group: General Forum Members
Points: 452 Visits: 856

I have always found that workflow scripts are hard to manage because you can't see them in the designer. When you go to edit old packages that you have forgotten or someone elses code it is hard to figure out what is going on when steps don't fire because of the workflow script. Instead I use activeX scripts to enable and disable future steps based on previous actions. These are easier to maintain because youcan see the step in the designer.

I use the following subs to set precedence and diable steps.

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

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








Francisco Rodriguez-252375
Francisco Rodriguez-252375
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 33

Hi, Wayne, good article.

I have one question.

I run a step that moves info from one table to another and if one or more records were copied I'd like to move to another step (just if records where copied) and if there was an error or no records were copied I'd like to move to a different step. I don't want to depend on success of the step because if there were no records to copy I would receive a success status.

How can I do this ?

Thanks in advance


Lawrence Rajan
Lawrence Rajan
Valued Member
Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)

Group: General Forum Members
Points: 54 Visits: 9

Hi Francisco,

To address your question, you can create another Execute SQL Task after the transformation task that does a COUNT(*) from the destination table and if records exist, proceed with the flow that Wayne explained in his article. Hope this helps.


Carlos Urbina
Carlos Urbina
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 1

Superlative article! worthy of a DTS for Dummies book.

What I've seen before are MRPOLECAT type scripts which I'm too dumb to get to work.

But your scripts really helped. I have a ton of places where I can use this.


Chada
Chada
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 72

A very nice article!

Scripting is really helpful. I have a many a places to pen down where I can use this type of scripting.


shailendra-251422
shailendra-251422
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 Visits: 49

This is excellent!!

I had attempted using that option but could never figure out how it should be used. This will really help me. Thanks!


Ralph D. Wilson II
Ralph D. Wilson II
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 38

At one time, I would have considered this to be a "fluff" article that was so obvious that it was a waste of time to read, much less to write. However, I have recently discovered that, apparently, an awful lot of DBAs come from a non-programming background and that makes this kind of article very valueable.

Please, don't get me wrong, I am not making a negative comment . . . I am saying that your article:

  • Is valuable to the community;
  • Has helped me recognize that I may have an advantage due to both the quantity and nature of my experience;
  • reminds me that the "little things" that one sometimes assumes are "common knowledge" may actually be anything but "common knowledge."


alexx
alexx
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 150
great work man...simply with great potential ..sorry my english...



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search