SSIS imported lines count
Hello all, good afternoon or good morning or good evening, where applicable... :)) I have a scenario on wich I import a flat file, but now at the end of the flat file there will be the info about the number of lines present in the file. I want to compare it with the counting of records of the task. Maybe at the end of the task have I'll a script that reads the file, seeks the end and parses the counter and then compares it with SSIS last task counter. How can I acess a previous task's row count? Thanks in advance
January 29th, 2011 7:07pm

Hello, If you are trying to validate your file , Why go through couple of task, Use Script task at initial and then read the number or all rows , Count them in Script task , and then read the last line , then compare them in script task and if they are equal then return Any value to variable , lets say Y and then use Precedence constraint , to check if Y then use Data flow to load that file otherwise send email. Or the other way, Read the last line from file by using script task and save the value in variable then use DFT and count the rows by using RowCount after after that use precedence constaint to make decision if Rows count by script is matching by row count by data flow. Thanks
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 7:17pm

You can use the rowcount component in the dataflow task. This will count the imported rows and you can have it set to a package variable for later use.
January 29th, 2011 7:32pm

reading and countig seems at the same time seems more overheadish and I have really big files to import. Thansk
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 7:50pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics