Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
#SQLServer 46
SQL Server 44
SSRS EXPERT 41
BI 36
#BI 33
brh 28
SSIS BEST PRACTICES 23
TSQL 19
MS BI STACKS 18
SSRS 17

Archive · View All
March 2011 24
July 2011 17
February 2011 15
April 2010 13
June 2011 11
May 2011 11
April 2011 11
July 2010 11
March 2010 8
December 2011 7

SSIS #104 – When Row Count Transformation is invaluable

Dec 21 2011 2:05AM by Sherry Li   

The Row Count transformation is a pretty straightforward transformation. It does the following two things:

1. It counts rows as data passes through a data flow, and

2. it stores the final count in a variable. (Note that the variable is only populated when the data flow is finished, not while the data flow is still in the middle of transferring data.)

Here is a data flow design pattern I use very often.

At the end of the data flow, my variable @vNewQueueCount is populated with the row count from the data source.

Then I use this variable @vNewQueueCount in a Precedence Constraint expression, as shown below, to decide conditionally whether I need to process my Queue dimension or not.

Configuring the Row Count transformation is simply enough. I’ll show you that later in this blog.

What I want to say first is why the Row Count transformation is invaluable in this specific design pattern.

In this design, I’ve decided to use the Recordset Destination, which is a in-memory ADO dataset and it saves data in memory in a recordset that is stored in an Integration Services package variable of the Object data type. In my next blog, I’ll show you how to use a Foreach Loop container with the Foreach ADO enumerator to process one row of the recordset at a time.

The Recordset Destination is a handy component to use when you do not need to (nor want to) persist your data. One drawback of using the in-memory ADO dataset is that Integration Services does not provide any out-of-box methods to get the row count in the dataset. This is when Row Count transformation becomes invaluable to me. Without too much work on my side, I am able to accomplish the following:

1. Retrieve data from the source, and store the data in a, ADO dataset.

2. Also store the row count in a variable.

3. Finally, be able to use the row count variable to conditionally decide whether I need to process my dimension or not.

Here are a few simple steps to configure the Row Count transformation.

1. Define a variable vNewQueueCount.

2. Create a new data flow

3. Drag the Row Count transformation to the data flow design surface. On the Advance Editor, for VariableName select User::vNewQueueCount.

Finally, you can use the variable in a precedence constraint expression to do conditional processing:

@vNewQueueCount > 0

Have fun with the Row Count transformation!

Tags: SSIS BEST PRACTICES, #SQLServer, SQL Server, BI, #BI,


Sherry Li
14 · 12% · 3827
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"SSIS #104 – When Row Count Transformation is invaluable" rated 5 out of 5 by 1 readers
SSIS #104 – When Row Count Transformation is invaluable , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]