dbTalk Databases Forums  

flow in dts sql task

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


Discuss flow in dts sql task in the microsoft.public.sqlserver.dts forum.



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

Default flow in dts sql task - 06-21-2004 , 09:09 AM






in a sql step of a dts package the code is
checking the count of a table.
if the count is greater than 0 i'd like
the success part to execute,
otherwise the failure part to execute.

is there a way to have the flow go to
a different task based on this conditional
sql code with dts?

tia,
dk

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

Default Re: flow in dts sql task - 06-21-2004 , 09:36 AM






Why?

IMHO the failure flow should be followed on Failure

Personally I would do this

1. ExecuteSQL task to read the result of SELECT COUNT(*) as Result FROM
TABLE into a Global Variable
2. In an Active Script Task you read the value of the Variable

DTSGlobalVariables("Name of GV").Value

3. You then use Workflow to do your branching.

Multiple Paths in Workflow
(http://www.sqldts.com/default.aspx?218)


Let's face it. If the count in the table is 0 you have not really failed at
anything: you have just decided not to execute a certain part of the
package. You will probably prefer to exit gracefully.


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


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

Quote:
in a sql step of a dts package the code is
checking the count of a table.
if the count is greater than 0 i'd like
the success part to execute,
otherwise the failure part to execute.

is there a way to have the flow go to
a different task based on this conditional
sql code with dts?

tia,
dk



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.