October 14, 2019 at 2:58 pm
Hi All,
i have a task to check file (excel & text) before loading to a table.
checking condition: if file only contains header(columns) without any data then fail the file.
I have filename & source file path variables already - any idea how to handle this in script task?
much appreciate!
October 14, 2019 at 3:13 pm
Set up your connection manager with column headers. In your data flow task add a Row Count as the first transform in the data flow and store the count in a variable , the next transform should then be a conditional split where you read the Row Count where you can then decide what to do if it = 0 or not.
October 14, 2019 at 3:52 pm
thanks tim,
what i want to design is even before going to data flow i want to perform all the checks and based on the condition i have all the follow up tasks for failing the file- so in this case i have to use script task to perform this validation.
October 14, 2019 at 4:31 pm
You could implement caojunhe24's suggestion in a separate data flow, store the row count in a package variable, and test it before branching to your primary data flow.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy