In message <DE54484B-99F6-4876-9901-0194241CEC17 (AT) microsoft (DOT) com>, Ananth
<anonymous (AT) discussions (DOT) microsoft.com> writes
Quote:
Hello,
I have a DTS package with several steps and am trying to provide a
front-end for the user which will
list the steps and show a progress bar on executing each step (very
similar to the one provided by SQL Server
itself)...however, I do not seem to get the steps IN ORDER..FYI, I am
using C# (WinForms)...
The interface provided by SQL Server seems to pick the steps in the
right order...on searching, it seems that
we can evaluate the PrecedenceConstraints property to get the right
order..Since I'm a newbie to DTS, any help
/sample (in any language) to retrieve the list of steps IN ORDER would
be useful.
Thanx
Ananth |
Why not take a simper approach and only populate your progress list as
tasks start executing. You could drive this quite happily off events.
To determine order of execution you would need to enumerate all steps as
constraints are held by the task they go to, not from.
For each step, enumerate the PrecedenceConstraints collection, to get
the PrecedenceConstraint objects. The StepName is the preceding step, So
if a step as no PrecedenceConstraints it is the start step. Not sure
that this guaranteed to 100 accurate either as in theory you can change
the basis and result to in effect be a "On Preceeding Step Not Run", and
have a circular reference, but I suspect DTS itself may have the same
problem as you in this case, so probably not worth worrying about for
the start step, but perfectly valid elsewhere.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org