dbTalk Databases Forums  

Terminate a package execution

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


Discuss Terminate a package execution in the microsoft.public.sqlserver.dts forum.



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

Default Terminate a package execution - 08-18-2004 , 09:53 AM






Hi... I've sent this question before, but it's still not very clear.
I have a package with many tasks and I am executing a loop in an ActiveX
task. Inside this task I execute a task according to a global variable and
then I decide whether to terminate the package or not.
The problem is, when I make the test and decide to terminate the package I
use the following code:

If (DTSGlobalVariables("var1").Value = 0) and
(DTSGlobalVariables("var2").Value = 0) Then
Main = DTSTaskExecResult_Failure '(1)
Else
Main = DTSTaskExecResult_Success '(2)
End If

But I didn't want to terminate the package with error (1), and if I choose
the (2) it follows for the next task, while it should have been already
finished.
I hope it's clear...
Thanks...
Eduardo



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

Default Re: Terminate a package execution - 08-18-2004 , 03:21 PM






You really do not want to finsish a package with a Failure reult in one of
the tasks do you.

Check your variable as you do.

If you decide to continue in the package then enable the steps to do that.
If you decide to not continue then disable those steps.
The package will complete gracefully.

We do this here

Looping, Importing and Archiving
(http://www.sqldts.com/Default.aspx?246)

--
--

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


"Eduardo Greco" <eduardo (AT) persocom (DOT) com.br> wrote

Quote:
Hi... I've sent this question before, but it's still not very clear.
I have a package with many tasks and I am executing a loop in an ActiveX
task. Inside this task I execute a task according to a global variable and
then I decide whether to terminate the package or not.
The problem is, when I make the test and decide to terminate the package I
use the following code:

If (DTSGlobalVariables("var1").Value = 0) and
(DTSGlobalVariables("var2").Value = 0) Then
Main = DTSTaskExecResult_Failure '(1)
Else
Main = DTSTaskExecResult_Success '(2)
End If

But I didn't want to terminate the package with error (1), and if I choose
the (2) it follows for the next task, while it should have been already
finished.
I hope it's clear...
Thanks...
Eduardo





Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: Terminate a package execution - 08-18-2004 , 03:25 PM



In message <#mLtnPVhEHA.3932 (AT) TK2MSFTNGP09 (DOT) phx.gbl>, Eduardo Greco
<eduardo (AT) persocom (DOT) com.br> writes
Quote:
Hi... I've sent this question before, but it's still not very clear.
I have a package with many tasks and I am executing a loop in an ActiveX
task. Inside this task I execute a task according to a global variable and
then I decide whether to terminate the package or not.
The problem is, when I make the test and decide to terminate the package I
use the following code:

If (DTSGlobalVariables("var1").Value = 0) and
(DTSGlobalVariables("var2").Value = 0) Then
Main = DTSTaskExecResult_Failure '(1)
Else
Main = DTSTaskExecResult_Success '(2)
End If

But I didn't want to terminate the package with error (1), and if I choose
the (2) it follows for the next task, while it should have been already
finished.
I hope it's clear...
Thanks...
Eduardo


You can use workflow script to gracefully terminate a package, or rather
not execute a following task. Here is a simple example-

How can I check if a file exists?
(http://www.sqldts.com/default.aspx?211)
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.