SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Contitional Split based on query result
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

masterdineen
Aged Yak Warrior

United Kingdom
548 Posts

Posted - 05/08/2013 :  04:34:08  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 05/08/2013 :  04:48:05  Show Profile  Reply with Quote
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

United Kingdom
548 Posts

Posted - 05/08/2013 :  07:19:38  Show Profile  Reply with Quote
excellent

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

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 05/08/2013 :  12:36:38  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000