Fast load error output doesn't redirect entire batch

牧云@^-^@ 提交于 2020-12-15 05:30:45

问题


Context

I am developing a simple SSIS package that contains a Data flow Task with:

  • 1 OLE DB Source
  • 2 Lookup Transformations
  • 1 OLE DB Destination
  • 1 OLE DB Destination for error output rows

I am using the FastLoad option in both OLE DB Destinations and i have configured the error output of the first one to redirect rows to the second destination.

Question

From many online articles, i read that using Fastload option will cause the entire batch to fail an not only erroneous rows are redirected.

  • Error Handling With OLE DB Destinations
  • Error output in OLE DB Destination. How to redirect a row?
  • How to handle Failed Rows in a Data Flow
  • Have your SSIS Fast Load (Bulk Load) and Row by Row Error Messages too

But when executed the package only 2 rows are redirected and all other rows are imported successfully. And i checked that the sum of the rows count in both destination is equal to the source row count which means that only erroneous rows are redirected.

Note that:

  • Max Commit size = 2147483647
  • Batch size is empty
  • Table lock and check constraints option are checked
  • I am using SQL Server 2014 with Visual Studio 2013

I didn't find any similar case online. Any explanation?


回答1:


What @DanGuzman mentioned is true, since there are 2 phases of validation for the data when it comes to the OLE DB Destination:

  1. Client-side validation
  2. Server-side validation:

1. The Client-side validation:

When data from the pipeline to the OLE DB destination the pipeline columns (External columns) are mapped to the OLE DB Destination Input columns which must have a data type relevant to the server side columns data types (Database Engine). If an error occured While data is passed from External columns to the OLE DB destination inputs columns the error row can be redirected alone.

Example: Implicit conversion failure: When a DT_STR field is mapped to a DT_DATE and it contains an invalid date value

When we say that Fastload option load data in batches we are talking about the phases when data are sent from the OLE DB destination input columns to the destination itself (Database engine)

2. Server-side validation

This type of validation is done when inserting data to the destination such as Identity, primary key or foreign key violation ...

If an error occurs in this phase the whole batch is rejected and all rows are redirected to the error output.



来源:https://stackoverflow.com/questions/56596650/fast-load-error-output-doesnt-redirect-entire-batch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!