Solved

SSIS: validating data loaded from flat file into the table

Posted on 2013-12-03
3
819 Views
Last Modified: 2016-02-10
What is the best way to make sure that number of rows in flat file match number of rows in the database?
Thanks.
0
Comment
Question by:quasar_ee
  • 3
3 Comments
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 500 total points
ID: 39693153
Add a Row Count transform right after the source to get the number of rows in the flat file.

>match number of rows in the database?
Assuming you mean the target table...
The easy way would be to use Task Factory's Upsert Task, which writes the inserted rows to a variable, then you could just compare the two variables.
Without that, afaik SSIS does not have functionality in its Destination Task to do a rowcount of inserts, so you'd probably have to do a SELECT COUNT(*) before and after the data pump.
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39693154
Just discovered you can add a row count after the destination task, which only works for the errors, which means you could add a Row Count Transform between the two, assign to a variable, and test to make sure it is zero.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39701675
Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
T-SQL: Do I need CLUSTERED here? 13 44
Return 0 on SQL count 24 30
SSIS 2008  Datetime Converstion to Excel 3 13
replace \ by - in select 4 21
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question