Friday, February 24, 2012

Handling bad data

I have an SSIS package that takes in a flat file and pushes the data into a table. However, once in a while the file will have some bad data in it (for example, this particular time I have too many delimiters on one line). I want the package to redirect the row to an error table and keep going with the processing for the rest of the data. To do this, I have hooked up an error output from the flat file source to an OLE DB destination and assigned all the rows to Redirect Row on Error in the Error Output section of the flat file source. Unfortunately, it does not work! The flat file receives an error and stops. Is this because something different has to happen when it is a problem with the whole row? Any help would be appreciated, thanks.Make sure you you visit the 'error output' page of the flat file source and change the value of the ERROR column to redirect row...|||Unfortunately, I've done this and it still doesn't work. I double checked and all of the columns in the Error Output section are set to Redirect Row.|||Perhaps you could have a first data flow that treats each line in the file as a single column; the with a script component you parse each row to count the number of delimiters and exclude those that exceeds the expected number. Just a thought...|||

That sounds like it should work! I haven't had a chance to work on it since I've been sidetracked into another project. Thanks for the help, I'm sorry that this took SO long for me to respond.

|||

Here's an example. hopefully it helps:

http://agilebi.com/cs/blogs/jwelch/archive/2007/05/08/handling-flat-files-with-varying-numbers-of-columns.aspx

No comments:

Post a Comment