Row Count Transformation


The Row Count transformation counts rows as they pass through a data flow and stores the final count in a variable.
Step 1:

Click Windows button and go to SQL Server 2008 R2 and run as a administrator.


It shows  a bellow window.


Step 2:

Go to a views and create a new project ( Short cut of New Project is Ctrl + Shift + N).


Step 3:

Give a project name (e.g. IS) and click OK button and then shows a bellow window.


Step 4:
To drag and drop the Data Flow Task


Step 5: 

To edit the Data Flow Task then it open a Data Flow


Stem 6:

To dag and drop the OLEDB source and edit it.


Step 7:
To give a OLEDB connection and select the table from given data base and select which columns are required.



Step 8:

Drag and drop Row Count transformation and create variable as RowCount.




Step 9:

Edit Row Count transformation and select variable name as User::RowCount.



Step 10:

Take one script task in control flow and give connection to data flow task and edit it.


Step 11:
Edit script task and write a bellow command line
  
     MessageBox.Show("The RowCount=" +Dts.Variables ["User::RowCount"]. Value);



Step 12:

Execute a task and it shows a total number of rows in a selected table.

















Comments

Popular Posts

Failed to execute the package or element. Build errors were encountered

Exception deserializing the package "The process cannot access the file because it is being used by another process."

Temporary enable and disable SSRS subscriptions