Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SSIS: validating data loaded from flat file into the table

Posted on 2013-12-03
3
Medium Priority
?
855 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.

609 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