Yes, sort of. Create two outputs on your script component, one for rows to keep and one to throw away. Then use the DirectRow to send them down the keep or throw away output.
You cannot stop the data flow, and prevent whatever source from reading more, you kind of filter then to an empty output.
|||i was hoping there is a way to stop the source from reading but you've answered my question, you can't.
Thanks!
|||Thanh Duong wrote:
i was hoping there is a way to stop the source from reading but you've answered my question, you can't.
Thanks!
Also be aware that if you use an asynch script component you don't have to divert the rows. If you don't do anything with them then they just disappear.
Performance-wise you might still be best doing this synchronously though.
All discussed here:
Select Top N in a data-flow
(http://blogs.conchango.com/jamiethomson/archive/2005/07/27/1877.aspx)
And there's a follow-up article that compares the two approaches in terms of performance that was published in a back issue of SQL Server Standard. Unfortunately there's no list of back issues on their website so I don't know which issue it was in.
-Jamie
No comments:
Post a Comment