I have an OLE DB connection to an IBM DB2 source. I am trying to bring in some data from a query on a few tables. One of the fields I am trying to import is defined as a CHARACTER with a length 70.
When I run the package, I get the following errors:
[OLE DB Source [1]] Error: There was an error with output column "CC_COMMENT" (743) 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.".
[OLE DB Source [1]] Error: The "output column "CC_COMMENT" (743)" failed because truncation occurred, and the truncation row disposition on "output column "CC_COMMENT" (743)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
I have tried adding a Data Conversion and converting to both DT_STR and DT_WSTR with Lengths of 70 and 255.
I have tried inserting into both a varchar(max) field as well as a char(255) and an nvarchar(max)
check for on error property inside task and in dropdown select redirect to output and then you'll get an additional output (red line) for task. you can link this to a text file destination task to capture error values
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
I believe the error output has shed some light on the problem. It appears that the records that are failing have some unknown character in place of the apostrophe?
examples: THAT?S I?M CAN?T DIDN?T
These words appear as such in the actual source system: THAT S I M CAN T DIDN T
I have no idea how this happened.
So now that I have found the problem, how do i account for these unknown characters and ignore them so that the rest of the text comes over?
I believe the error output has shed some light on the problem. It appears that the records that are failing have some unknown character in place of the apostrophe?
examples: THAT?S I?M CAN?T DIDN?T
These words appear as such in the actual source system: THAT S I M CAN T DIDN T
I have no idea how this happened.
So now that I have found the problem, how do i account for these unknown characters and ignore them so that the rest of the text comes over?
You need to understand what exactly were those characters. they might be some unprintable characters. Try to get their ASCII value and then use derived column task using REPLACE() function to strip them off
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/