SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Issues With DB2 CHARACTER Source
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

paulkem
Starting Member

25 Posts

Posted - 01/11/2013 :  10:00:49  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 01/11/2013 :  10:19:49  Show Profile  Reply with Quote
whats the datatype in destination field?

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

Go to Top of Page

paulkem
Starting Member

25 Posts

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

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 01/11/2013 :  11:28:28  Show Profile  Reply with Quote
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

25 Posts

Posted - 01/14/2013 :  09:15:51  Show Profile  Reply with Quote
I am not sure how to do that.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 01/14/2013 :  10:04:32  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
2067 Posts

Posted - 01/14/2013 :  11:08:29  Show Profile  Visit jackv's Homepage  Reply with Quote
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

25 Posts

Posted - 01/14/2013 :  12:24:56  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 01/15/2013 :  00:16:37  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000