Two rows passed to error handler instead of one....


scenario:

flat file conneciton manager import, , error exporting
oledb destination successful data.

transforms connecting flat file source oledb destination on success, , script component, , flat file destination in event of error.

goal:

very basic - take rows flight file, pipe delimited (cr/lf rows) source, , map table, exporting records error out error file.

symptom:

given 3 row file (just test), first record missing column, wind 2 records (the record know has error, plus following record) in error file, , 3rd record in success file. 1 one record reported going each file (so, error transform shows single record, though 2 wind in file). couple of lines of code move things on follows...

_erroredrow = system.text.encoding.ascii.getstring(row.flatfilesourceerroroutputcolumn.getblobdata(0, (int)row.flatfilesourceerroroutputcolumn.length));        output0buffer.addrow();        output0buffer.record = _erroredrow;

what suspect happening here delimiter @ end of first (error) record being missed, , appears 2 rows (and each have appropriate cr/lf) being treated one.

any hints why happening appreciated. 1 of things know i'm missing increadibly simple, but, nonetheless, i'm missing it....


rob vieira

hello robert,

this little complicated, sometime miss small things , hard track them.

please check following possibilies

1--when configured flat file source, did go advance tab , defined data type according destination, lets have int in destination 1 column , data comming varchar, default flat flat convert dt_str,50(varchar). please define data type in advance according destination redirect source if data type different.

2--flat file source, redirecting rows on error or truncation. on error lets have defined int in advance tab , destination has int , , file come varchar value , record redirect can create error, on truncate , if have defined data type varchar(10) , data comming file has lenght more varchar(10) redirected too.

you need check these both , sure 1 row pass these tests?

3--lets have data comming file

1|test

2|test1|400

3|test3|500

the first will ignored , see 2 rows moving in pineline,why first ignore think did not ended correct delimited, if have records this

1|test|

2|test1|400

3|test3|500

then record writtin table , blank replaced 0, 1 test 0 first record , rest of them fine.

please check these setting , see if missing , please provide data , destination table metadata settings have flat file source , better can provided.

thanks



SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607