开发者

SSIS cannot determine the correct datatype of the column

开发者 https://www.devze.com 2023-03-02 14:20 出处:网络
I have a simple SSIS package that picks data from Oracle database and inse开发者_Python百科rts data to sql server. In DataFlow I have 3 tasks:

I have a simple SSIS package that picks data from Oracle database and inse开发者_Python百科rts data to sql server. In DataFlow I have 3 tasks:

  1. I have a OLE DB source that runs a very simple query. Select Col1, Col2, Col3, Col4, Col5, Col6, Col7 From Table.
  2. Then I have a Data conversion task that converts col6 and col7 from unicode STRING[DT_WSTR] to STRING[DT_STR].
  3. OLE DB Destination(sql server).

ERROR: SSIS turns the OLE DB Source Task to Red and displays the following error:

There was an error with output column "Col3" (23) on output "OLE DB Source Output" (11). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".

The "output column "Col3" (23)" failed because truncation occurred, and the truncation row disposition on "output column "OS_VISIT_ID" (23)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

But Col3 is not text its a Number, and SSIS is detecting it as unicode STRING[DT_WSTR]. I even tried to convert Col3 to Numeric in Data Conversion task before it goes to OLE DB Destination. But I still get the same error.


Click Error Output - choose truncation, and select redirect row. Then add a Union stage after the source to connect both the regular output with the "error" rows. Attach a data viewer to the error line and see what kind of data it's complaining on. It will now run the task as normal.

PS: Some oddball provider drivers -require- you to do this, even though it never "fails" per se. For example Acucorp XBDC drivers (that read some strange db format flat files) - will fail if you don't setup an error output, even though every row will go through the normal output once you have the error row configured.

0

精彩评论

暂无评论...
验证码 换一张
取 消