dbTalk Databases Forums  

Data Conversion task - TruncationRowDisposition

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Data Conversion task - TruncationRowDisposition in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Erik Caha
 
Posts: n/a

Default Data Conversion task - TruncationRowDisposition - 05-12-2006 , 04:15 PM






Hello,

I have, very simple dataflow task:

OLEDB Source
[varchar(12) CodeId "ASDF "]
Quote:
V
Data Conversion
[varchar(12) CodeId -> nvarchar(8) CodeId]
Quote:
V
OLEDB Destination
[nvarchar(8) CodeId]

The task fails with this error message:

Data conversion failed while converting column "CodeId" (20) to column
"CodeId" (114). The conversion returned status value 2 and status text
"The value could not be converted because of a potential loss of data.

OK, I set property TruncationRowDisposition = RD_IgnoreFailure, but the
task still fails with same message. It looks like setting property did
not affect result.

When I set property ErrorRowDisposition = RD_IgnoreFailure, conversion
task succeed, but OLEDB Destination fail with following error message:

There was an error with input column "CodeId" (126) on input "OLE DB
Destination Input" (83). The column status returned was: "The value
violated the integrity constraints for the column.".

There is solution, set conversion as [varchar(12) CodeId -> nvarchar(12)
CodeId] and than whole data flow task succeed only with warning.
However, it is not clean solution and I do not know where I made the
mistake or how can I accomplish this simple task.

Thanks


--
-----
Erik Caha


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Data Conversion task - TruncationRowDisposition - 05-15-2006 , 05:03 AM






Hello Erik,

So here is what I did

CREATE TABLE A (col1 VARCHAR(12))
GO
INSERT A VALUES('AAAAAAAAAAAA')
GO
CREATE TABLE B (col1 NVARCHAR(8))


I then added a Data Conversion transform to take the VARCHAR(12) to an NVARCHAR(8).
I set the ERRORROW and TRUNCATION row disposition to IGNORE on the new column
from thee DC Conver (Copy Of Col1)

I then sent the "Copy Of Col1" column to the Col1 in Table B and it worked
fine.

Are you trying to sent the original column to the destination?


Allan



Quote:
Hello,

I have, very simple dataflow task:

OLEDB Source
[varchar(12) CodeId "ASDF "]
|
V
Data Conversion
[varchar(12) CodeId -> nvarchar(8) CodeId]
|
V
OLEDB Destination
[nvarchar(8) CodeId]

The task fails with this error message:

Data conversion failed while converting column "CodeId" (20) to column
"CodeId" (114). The conversion returned status value 2 and status
text "The value could not be converted because of a potential loss of
data.

OK, I set property TruncationRowDisposition = RD_IgnoreFailure, but
the task still fails with same message. It looks like setting property
did not affect result.

When I set property ErrorRowDisposition = RD_IgnoreFailure, conversion
task succeed, but OLEDB Destination fail with following error message:

There was an error with input column "CodeId" (126) on input "OLE DB
Destination Input" (83). The column status returned was: "The value
violated the integrity constraints for the column.".

There is solution, set conversion as [varchar(12) CodeId -
nvarchar(12) CodeId] and than whole data flow task succeed only with
warning. However, it is not clean solution and I do not know where I
made the mistake or how can I accomplish this simple task.

Thanks




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.