?
Solved

SSIS: validating data loaded from flat file into the table

Posted on 2013-12-03
3
Medium Priority
?
841 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 66

Assisted Solution

by:Jim Horn
Jim Horn earned 2000 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 66

Accepted Solution

by:
Jim Horn earned 2000 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 66

Expert Comment

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

Featured Post

Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

762 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