<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'SQL Server Integration Services', 'repost', 'ssis', and 'OnPipelineRowsSent'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+Server+Integration+Services,repost,ssis,OnPipelineRowsSent&amp;orTags=0</link><description>Search results matching tags 'SQL Server Integration Services', 'repost', 'ssis', and 'OnPipelineRowsSent'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>[SSIS] OnPipelineRowsSent event</title><link>http://sqlblog.com/blogs/jamie_thomson/archive/2011/08/19/ssis-onpipelinerowssent-event.aspx</link><pubDate>Fri, 19 Aug 2011 11:48:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37927</guid><dc:creator>jamiet</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;Once upon a time I blogged at &lt;a href="http://consultingblogs.emc.com/jamiethomson" target="_blank"&gt;http://consultingblogs.emc.com/jamiethomson&lt;/a&gt; but that ended in August 2009 when I left EMC. There is a lot of valuable content over there however certain events in the past leave me concerned that that content is not well cared for and I don't have any confidence that it will still exist in the long term. Hence, I have taken the decision to re-publish some of that content here at SQLBlog so over the coming weeks and months you may find re-published content popping up here from time-to-time.&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;This is the first such blog post in &lt;a href="http://sqlblog.com/blogs/jamie_thomson/archive/tags/repost/default.aspx" target="_blank"&gt;this series&lt;/a&gt; in which I talk about the little-known OnPipelineRowsSent event.&lt;/i&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;/blockquote&gt;

&lt;p&gt;An &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1317964&amp;amp;SiteID=1"&gt;interesting discussion&lt;/a&gt; today on the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&amp;amp;SiteID=1"&gt;SSIS Forum&lt;/a&gt;
 made me realise that perhaps not&amp;nbsp;all SSIS developers&amp;nbsp;are aware of the 
OnPipelineRowsSent event in SSIS and how valuable it can be, certainly 
when debugging data-flows. This isn't all that surprising because &lt;a href="http://msdn2.microsoft.com/en-us/library/ms141026.aspx"&gt;Books Online&lt;/a&gt;&amp;nbsp;is very sparse in this area. Hence I thought it would make a useful blog topic.&lt;/p&gt;

&lt;p&gt;OnPipelineRowsSent
 is a type of&amp;nbsp;event in SSIS which means the&amp;nbsp;information that it provides
 can be logged&amp;nbsp;by whatever log provider you happen to be using.&amp;nbsp;In 
order&amp;nbsp;to understand the information that OnPipelineRowsSent provides it 
is critical to understand the buffer architecture of the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms141122.aspx"&gt;SSIS data-flow&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To
 explain&amp;nbsp;that&amp;nbsp;VERY simply, a buffer is an area of memory that contains 
rows of data as they pass through the pipeline. Each data-path in the 
data-flow&amp;nbsp;will contain one of more buffers and each of those buffers 
(except for the last one) will contain the same number of rows. If you 
want to understand more about the buffer architecture of the data-flow 
then &lt;a href="http://www.amazon.com/Microsoft-Server-2005-Integration-Services/dp/0672327813"&gt;Kirk Haselden's book&lt;/a&gt; has a chapter devoted wholly to it.&lt;/p&gt;

&lt;p&gt;Here is what Books Online &lt;a href="http://msdn2.microsoft.com/en-us/library/ms141122.aspx"&gt;DOES say&lt;/a&gt; about OnPipelineRowsSent:&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;&lt;b&gt;OnPipelineRowsSent&lt;/b&gt; &lt;/p&gt;
&lt;/td&gt;

&lt;td&gt;
&lt;p&gt;Reports the number of rows provided to a component input by a call to the &lt;b&gt;ProcessInput&lt;/b&gt; method. The log entry includes the component name. &lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;In
 slightly plainer english that means that for every buffer of data that 
is consumed by a component, you get a log entry. So, if you have&amp;nbsp;(e.g.) a
 &lt;a href="http://msdn2.microsoft.com/en-us/library/ms141069.aspx"&gt;Derived Column Component&lt;/a&gt;&amp;nbsp;that
 receives 105000&amp;nbsp;rows and the size of the buffer is 10000 rows, you'll 
get 11 OnPipelineRowsSent log entries for that&amp;nbsp;component&amp;nbsp;(there will 
only be 5000 rows in the last buffer).&amp;nbsp;Basically it enables you to know 
how many rows are passing through each data-path in the data-flow.&lt;/p&gt;

&lt;p&gt;The available information is the same as you get for any eventhandler. &amp;nbsp;i.e. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;event&lt;/li&gt;

&lt;li&gt;computer&lt;/li&gt;

&lt;li&gt;operator&lt;/li&gt;

&lt;li&gt;source&lt;/li&gt;

&lt;li&gt;sourceid&lt;/li&gt;

&lt;li&gt;executionid&lt;/li&gt;

&lt;li&gt;starttime&lt;/li&gt;

&lt;li&gt;endtime&lt;/li&gt;

&lt;li&gt;datacode&lt;/li&gt;

&lt;li&gt;databytes&lt;/li&gt;

&lt;li&gt;message&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and here is a portion of a logfile containing those records:&lt;/p&gt;

&lt;p&gt;&lt;font face="courier new"&gt;&lt;font color="#ff0000"&gt;OnPipelineRowsSent,CGOJATHOMSON,INT\Jamie.Thomson,Data
 Flow 
Task,{EB25C41A-EFE2-4902-9610-99C0309A3B59},{33B4926F-54A9-4E00-9B74-92720A2786E0},08/03/2007
 20:49:56,08/03/2007 20:49:56,0,0x,Rows were provided to a data flow 
component as input. :&amp;nbsp; : 1228 : Merge Join Output : 1225 : Union All 1 :
 1226 : Union All Input 1 : 9936&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;OnPipelineRowsSent,CGOJATHOMSON,INT\Jamie.Thomson,Data
 Flow 
Task,{EB25C41A-EFE2-4902-9610-99C0309A3B59},{33B4926F-54A9-4E00-9B74-92720A2786E0},08/03/2007
 20:49:56,08/03/2007 20:49:56,0,0x,Rows were provided to a data flow 
component as input. :&amp;nbsp; : 1475 : Union All Output 1 : 1470 : Sort 3 : 
1471 : Sort Input : 9936&lt;br&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;OnPipelineRowsSent,CGOJATHOMSON,INT\Jamie.Thomson,Data
 Flow 
Task,{EB25C41A-EFE2-4902-9610-99C0309A3B59},{33B4926F-54A9-4E00-9B74-92720A2786E0},08/03/2007
 20:49:56,08/03/2007 20:49:56,0,0x,Rows were provided to a data flow 
component as input. :&amp;nbsp; : 1228 : Merge Join Output : 1225 : Union All 1 :
 1226 : Union All Input 1 : 2085&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;OnPipelineRowsSent,CGOJATHOMSON,INT\Jamie.Thomson,Data
 Flow 
Task,{EB25C41A-EFE2-4902-9610-99C0309A3B59},{33B4926F-54A9-4E00-9B74-92720A2786E0},08/03/2007
 20:49:56,08/03/2007 20:49:56,0,0x,Rows were provided to a data flow 
component as input. :&amp;nbsp; : 1475 : Union All Output 1 : 1470 : Sort 3 : 
1471 : Sort Input : 9936&lt;br&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;OnPipelineRowsSent,CGOJATHOMSON,INT\Jamie.Thomson,Data
 Flow 
Task,{EB25C41A-EFE2-4902-9610-99C0309A3B59},{33B4926F-54A9-4E00-9B74-92720A2786E0},08/03/2007
 20:49:56,08/03/2007 20:49:56,0,0x,Rows were provided to a data flow 
component as input. :&amp;nbsp; : 1475 : Union All Output 1 : 1470 : Sort 3 : 
1471 : Sort Input : 2085&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;OnPipelineRowsSent,CGOJATHOMSON,INT\Jamie.Thomson,Data
 Flow 
Task,{EB25C41A-EFE2-4902-9610-99C0309A3B59},{33B4926F-54A9-4E00-9B74-92720A2786E0},08/03/2007
 20:49:56,08/03/2007 20:49:56,0,0x,Rows were provided to a data flow 
component as input. :&amp;nbsp; : 2121 : Sort Output : 2113 : Merge Join 2 : 2114
 : Merge Join Left Input : 9936 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;The important stuff is what comes in the last field, the message so&amp;nbsp;let's break that down. Here is an example message:&lt;/p&gt;

&lt;p&gt;&lt;font color="#0000ff" face="Courier New"&gt;Rows
 were provided to a data flow component as input. :&amp;nbsp; : 1030 : OLE DB 
Source Output : 1025 : Sort 2 : 1026 : Sort Input : 9972&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;And here's what it is constituted of:&amp;nbsp;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rows
 were provided to a data flow component as input. - That's consistent in
 each message, so to be honest they could have left it out&lt;/li&gt;

&lt;li&gt;&lt;div&gt;1030&amp;nbsp;- ID of the data-path providing the buffer&lt;/div&gt;&lt;/li&gt;

&lt;li&gt;&lt;div&gt;OLE DB Source Output - Name of the&amp;nbsp;data-path providing the buffer&lt;/div&gt;&lt;/li&gt;

&lt;li&gt;&lt;div&gt;1025 - ID of the component receiving the buffer&lt;/div&gt;&lt;/li&gt;

&lt;li&gt;&lt;div&gt;Sort 2 - Name of the component receiving the buffer&lt;/div&gt;&lt;/li&gt;

&lt;li&gt;&lt;div&gt;1026 - ID of the input receiving the buffer&lt;/div&gt;&lt;/li&gt;

&lt;li&gt;&lt;div&gt;Sort Input - Name of the input receiving the buffer&lt;/div&gt;&lt;/li&gt;

&lt;li&gt;&lt;div&gt;9972&amp;nbsp;- Number of rows in the buffer&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As
 you can see, this information will enable you to determine exactly how 
many rows are output from each component. Thus, if you are not receiving
 the expected number of rows at a destination this event will help you 
to deduce where you are losing them from.&lt;/p&gt;

&lt;p&gt;You may not know this 
but&amp;nbsp;you actually encounter OnPipelineRowsSent every time you run a 
data-flow within the SSIS Designer in&amp;nbsp;BIDS. Notice how the designer 
shows the number of rows passing through the pipeline and through each 
component:&lt;/p&gt;
&lt;img src="http://i1177.photobucket.com/albums/x349/jamiekth/df.jpg" alt="Photobucket" border="0"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;How&amp;nbsp;does the designer know how many rows are passing through the 
data-flow? Simple! Its because the SSIS Designer consumes the 
OnPipelineRowsSent event that the executing package "throws" up and 
then&amp;nbsp;presents that information visually&amp;nbsp;as the numbers that you see 
flashing in front of your eyes as the data-flow executes.&lt;/p&gt;

&lt;p&gt;I think 
that just about covers the simple stuff around OnPipelineRowsSent. If 
you have any questions then post them here as a comment.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/jamiet" target="_blank"&gt;@Jamiet&lt;/a&gt; &lt;br&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>