Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Contitional Split based on query result

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-05-08 : 04:34:08
Hello there.

I have a Data flow with OLE DB source which is a sql query.

Then I have the result to populate an excel sheet. But i want to fire off a script task after the data flow only if the row count from the query is > 0

how would I go about doing this?

Regards

Rob

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-08 : 04:48:05
use MUTICAST transform and create a branch of the main pipeline. Then add a rowcount transform in brach and give a variable created in ssis to store the rowcount value.
Then use this variable in expression for precedence constraint from data flow task to following script task. Use Expression And Constraint option and give expression as

@CountVariable ! = 0

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-05-08 : 07:19:38
excellent

thank you very much, all done
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-08 : 12:36:38
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -