RowCount Transformation in SSIS 2008R2 Example

94
161893
rowcount

RowCount Transformation :  The RowCount transformation provides a way to track how many rows are flowing through a particular path. You can use this information in logs as diagnostic information or for sending in an email as a notification of the work a package has completed.

Counts the rows flowing through the data flow and writes the final count in a variable. Here we are gonna discuss an example on the same.

In the Control Flow tab, add a variable named “RowCnt.” Ensure that the variable is package-scoped and of type Int32 .

Add a dataflow task and create a connection manager that connects to the AdventureWorksDW database. Add an OLE DB Data Source to the Data Flow design surface. Configure the source to point to your AdventureWorksDW database’s connection manager.

Double Click on the OLE DB Component and Select  SQL Command to write customized sql.

Add a Row Count Transform to the Data Flow.

Open the Advanced Editor and select the variable named “User::RowCnt” as the Variable Name property. Your editor should resemble.

When you edit Row Count Transformation you could see the Input Columns  and Input and Output Properties Tabs  along with Component Properties. Please ignore both of them.

RowCount Transformation has been configured. Now Return to the Control Flow tab and add a Script Task. This task is not really going to perform any action. Instead it will be used to show the conditional ability to perform steps based on the value returned by the Row Count Transform.

Connect the Data Flow Task to the Script Task. Double click on Script Task and  Set up the ReadOnlyVariable as User::RowCnt which was created as package variable and then Edit the script to write  the message box popup code.

Write the piece of script code to show the count value in alert message box.

Now the package is ready to be executed. Go to the Solution Explorer and right click on the package and select “Execute Package”. If all components turn “GREEN”, it means package has run successfully, if there is any error, the component which has failed to execute will be shown in “RED” Color.

Package executed successfully and shows the rows count as in message box. This is it guys !!

Thanks Sushil for the document.

Regards,
Roopesh Babu V

94 COMMENTS

  1. Мы занимаемся вывозом мусора газелями разной модификации от стандартных 6 м3 до больших 14 м3 есть также грузчики, работаем по Московской области. Преимущества вывоза мусора газелью в том, что она самая дешёвая услуга вывоза мусора.
    Эффективный способ вывоза мусора газелью, с минимальными затратами.
    Почему газель идеально подходит для вывоза мусора, которые важно знать.
    Какие материалы можно вывозить газелью, с учетом размеров и веса.
    Минимальные стоимость услуги по вывозу мусора газелью, и сохранить качество проведенных работ.
    Секрет успешного вывоза мусора газелью, соблюдая правила перевозки.
    вывоз старой мебели на свалку вывоз строительного мусора газелью .

  2. Nude models, artistic photography, fine art nudes, body positivity, figure studies, aesthetic nude photography, creative expression, portrait photography, sensual art, modeling portfolio, nude art photography, elegance of the human form

    [url=https://nugrls.com/][b]Click here to see![/b][/url]

  3. Top Earning App in Pakistan|Ideal Earning Option in Pakistan|Innovative Earning Method in Pakistan|Efficient Earning Tool in Pakistan|Profitable Earning App in Pakistan|Trustworthy Earning Platform in Pakistan|Processing App in Pakistan: Proven Tool|New level of income in Pakistan|Pakistan: leader in earning|App that will make it easier to earn in Pakistan Pakistan
    pakistan earn money app top 5 earning app in pakistan .

  4. What’s good?

    I was blown away!

    [url=https://juanhand-review.com/]juanhand review philippines[/url]

    Have a good one!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

− one = seven