dbTalk Databases Forums  

DTS Package Execute - Checking status of steps

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


Discuss DTS Package Execute - Checking status of steps in the microsoft.public.sqlserver.dts forum.



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

Default DTS Package Execute - Checking status of steps - 09-07-2004 , 10:04 AM






If a package has several steps and some of these do not run by design
(e.g. they only run if a specific step fails) then looping through the
steps checking for status as suggested in other posts does not always
help:

opkg.execute
Steps_Success = True
for each ostep in opkg.step
if ostep.Executionresult = DTSStepExecResult_Failure then
Steps_Success = False
end if
next
if Steps_Success = False then... ' take some appropriate action

The Executionresult property only returns Success or Failure. Any step
that "was not executed" returns Failure. Are there any work-arounds
that can be used within an ActiveX script to verify actual step
Failures vs. those that did not run? Thanks.

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS Package Execute - Checking status of steps - 09-07-2004 , 02:08 PM






What about

for each stp in DTSGlobalVariables.Parent.Steps
MsgBox stp.Name & " : " & Cstr(stp.StartTime)
Next


The not run step should have a time of 00:00:00



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"dcsi" <jc39ct (AT) hotmail (DOT) com> wrote

Quote:
If a package has several steps and some of these do not run by design
(e.g. they only run if a specific step fails) then looping through the
steps checking for status as suggested in other posts does not always
help:

opkg.execute
Steps_Success = True
for each ostep in opkg.step
if ostep.Executionresult = DTSStepExecResult_Failure then
Steps_Success = False
end if
next
if Steps_Success = False then... ' take some appropriate action

The Executionresult property only returns Success or Failure. Any step
that "was not executed" returns Failure. Are there any work-arounds
that can be used within an ActiveX script to verify actual step
Failures vs. those that did not run? Thanks.



Reply With Quote
  #3  
Old   
dcsi
 
Posts: n/a

Default Re: DTS Package Execute - Checking status of steps - 09-08-2004 , 10:18 AM



Excellent! Thanks Allan, that does the trick. The time after the Cstr
conversion actually comes back as "12:00:00 AM", easy enough to check
for.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
What about

for each stp in DTSGlobalVariables.Parent.Steps
MsgBox stp.Name & " : " & Cstr(stp.StartTime)
Next


The not run step should have a time of 00:00:00



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"dcsi" <jc39ct (AT) hotmail (DOT) com> wrote in message
news:77a44de7.0409070704.50acaf46 (AT) posting (DOT) google.com...
If a package has several steps and some of these do not run by design
(e.g. they only run if a specific step fails) then looping through the
steps checking for status as suggested in other posts does not always
help:

opkg.execute
Steps_Success = True
for each ostep in opkg.step
if ostep.Executionresult = DTSStepExecResult_Failure then
Steps_Success = False
end if
next
if Steps_Success = False then... ' take some appropriate action

The Executionresult property only returns Success or Failure. Any step
that "was not executed" returns Failure. Are there any work-arounds
that can be used within an ActiveX script to verify actual step
Failures vs. those that did not run? Thanks.

Reply With Quote
  #4  
Old   
dcsi
 
Posts: n/a

Default Re: DTS Package Execute - Checking status of steps - 09-08-2004 , 10:35 AM



That does the trick as well! Thanks again.

"Sreenath" <Sreenath (AT) discussions (DOT) microsoft.com> wrote

Quote:
Probably you check first the status of the step, whether it is
completed...then you can test for success or failure. If its not completed,
that means that step didn't run. Don't worry about that step. Or viceversa.



"dcsi" wrote:

If a package has several steps and some of these do not run by design
(e.g. they only run if a specific step fails) then looping through the
steps checking for status as suggested in other posts does not always
help:

opkg.execute
Steps_Success = True
for each ostep in opkg.step
if ostep.Executionresult = DTSStepExecResult_Failure then
Steps_Success = False
end if
next
if Steps_Success = False then... ' take some appropriate action

The Executionresult property only returns Success or Failure. Any step
that "was not executed" returns Failure. Are there any work-arounds
that can be used within an ActiveX script to verify actual step
Failures vs. those that did not run? Thanks.


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.