dbTalk Databases Forums  

If condition

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


Discuss If condition in the microsoft.public.sqlserver.dts forum.



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

Default If condition - 09-01-2005 , 02:34 PM






In a DTS I want to transfer data only if some conditions are met.
I get values from a table into global variables using an Execute SQL Task.

Then I use an ActiveX task to check the values. If the conditions are met I
return DTSTaskExecResult_Success, DTSTaskExecResult_Failure otherwise.

Then I connect the rest of the processing to the ActiveX task with a 'On
Success' workflow.

My problem is in case the conditions are not met, the ActiveX task returns
Failure and the step is shown as failed. When I run the DTS as a child of
another DTS, it shows the package failed, which can be confusing.

Is there a way to avoid this? Or maybe there's a more elegant
implementation...

Reply With Quote
  #2  
Old   
Francesco Anti
 
Posts: n/a

Default Re: If condition - 09-02-2005 , 09:32 AM






"fleo" <fleo (AT) discussions (DOT) microsoft.com> wrote in message
Quote:
In a DTS I want to transfer data only if some conditions are met.
I use an ActiveX task to check the conditions. If the conditions are met I
return DTSTaskExecResult_Success, DTSTaskExecResult_Failure otherwise.
My problem is in case the conditions are not met, the ActiveX task returns
Failure and the step is shown as failed. When I run the DTS as a child of
another DTS, it shows the package failed, which can be confusing.
You can skip the execution of a step without returning Failure. Read
http://www.sqldts.com/?214

Hope this helps
--
Francesco Anti




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

Default Re: If condition - 09-02-2005 , 02:14 PM



Thanks.
I had thought about it and didn't want to choose that option, but the
article was really helpful.

I did something a little different. Since I know the ActiveX script step
will always be successfull, I change the precedence constraint value of the
following step I want to take to "On success" and the other one to "On
Failure". Works nicely.

Thanks again

"Francesco Anti" a écrit :

Quote:
"fleo" <fleo (AT) discussions (DOT) microsoft.com> wrote in message
In a DTS I want to transfer data only if some conditions are met.
I use an ActiveX task to check the conditions. If the conditions are met I
return DTSTaskExecResult_Success, DTSTaskExecResult_Failure otherwise.
My problem is in case the conditions are not met, the ActiveX task returns
Failure and the step is shown as failed. When I run the DTS as a child of
another DTS, it shows the package failed, which can be confusing.

You can skip the execution of a step without returning Failure. Read
http://www.sqldts.com/?214

Hope this helps
--
Francesco Anti




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.