April 21, 2011 at 11:26 am
I have a series of packages that BULK INSERT millions of rows of data from flat files, when it comes across a bad record I don't want the entire thing failing, rather write it out to a flat file on the file system (let's say c:\ssis\err-output.txt)
During the import of my flat file source, I have the success connector going to the Derived column component, and the failure to redirect rows to this err-output.txt connection manager - this appears to be working fine.
Here's what I would like to know how to do: After everything has completed, how can I check the file to see if there's any new records in the file and then email it out if there's records?
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience
April 24, 2011 at 3:36 am
If I got your problem correctly then this is the One way to do that:
Write the last modified date in your err-output.txt file. Then at the end of your package read the error file for file names and compare if last modified date changes in any of those file.
If any file got updated during the period of run then its last modified date will also change. 😎
__________________________________________
---------------------------------------------------
Save our mother Earth. Go Green !!!
April 25, 2011 at 6:47 am
I would add a record counter to the error stream. Once done, check the value. If it's more than zero, you have errors.
April 25, 2011 at 1:43 pm
How would I go about adding that (forgive me but I'm not that accustomed to SSIS yet)
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience
April 26, 2011 at 3:26 am
First create a package level variable. Insert a row count transformation between the start and end points of the data flow. Assign the output to the variable that you have created.
If that's not enough, google SSIS Row Count for the details.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply