Groups | Blog | Home
all groups > sql server dts > june 2004 >

sql server dts : flow in dts sql task


dk
6/21/2004 7:09:58 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,
Allan Mitchell
6/21/2004 3:36:41 PM
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


[quoted text, click to view]

AddThis Social Bookmark Button