Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Issues With DB2 CHARACTER Source

Author  Topic 

paulkem
Starting Member

28 Posts

Posted - 2013-01-11 : 10:00:49
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)

In every case, it fails.

Any ideas?

PK

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-11 : 10:19:49
whats the datatype in destination field?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

paulkem
Starting Member

28 Posts

Posted - 2013-01-11 : 11:15:31
I have tried various destination data types. varchar(max), varchar(255), nvarchar.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-11 : 11:28:28
can you try puttinf an error output and dump results to text file and check data which is breaking?


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

paulkem
Starting Member

28 Posts

Posted - 2013-01-14 : 09:15:51
I am not sure how to do that.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-14 : 10:04:32
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/

Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-01-14 : 11:08:29
Are you using the SQL Server Import\Export Wizard?. There are some potential workarounds on : http://www.sqlserver-dba.com/2011/07/sql-server-import-data-from-db2-as400-iseries.html


Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

paulkem
Starting Member

28 Posts

Posted - 2013-01-14 : 12:24:56
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?

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-15 : 00:16:37
quote:
Originally posted by paulkem

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/

Go to Top of Page
   

- Advertisement -