Data Conversion
This is a common problem but i need to solve it. pls help me with a solution.
There was a error due to the difference in length of source column to that of the destination.
I used a data conversion task to match the column length.
Even after doing that i get an error.
November 22nd, 2010 3:18am
Hi. If you're converting the data type in a derived column using data type cast or using a data conversion component, you should be able to modify the lenght of new column. In a derived column you can add an expression to adjust the leght to the new column.
Some like NewColumn = Left(string_expression, int).
Then there is two basic ways to resolve this issue: Adjust the lenght of column at flow to equipare to destination column OR Adjust the lenght of destination column and fix it to column flow lenghtVctor M. Snchez Garca (ES) (BI) Hope this help. Please vote if you find this posting was helpful. if this is an answer to your question, please mark it. http://bifase.blogspot.com | http://twitter.com/atharky
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 3:25am
I am using data conversion component.
how do i do this:
>>Then there is two basic ways to resolve this issue: Adjust the lenght of column at flow to equipare to destination column OR Adjust the lenght of destination column and fix it to column flow lenght
November 22nd, 2010 3:29am
I am using data conversion component.
how do i do this:
>>Then there is two basic ways to resolve this issue: Adjust the lenght of column at flow to equipare to destination column OR Adjust the lenght of destination column and fix it to column flow lenght
To adjust the lenght of column in data flow
1) Review the lenght of destination column.
2) Edit the data conversion component and fix the Lenght value to the previous step lenght.
3) Configure error output on data conversion component to prevent truncate and manipulate these rows.
4) Add a derived column and connect the error output from data conversion
5) Add a new column (with same name that the column generated by data conversion component) with a Substring function to cut the string with the max lenght of column.
6) Add a union all component and connect the data conversion output and derived column ouput. Map the columns with same name.
I need some step more detailed, just tell me.
Víctor M. Sánchez García (ES) (BI) Hope this help. Please vote if you find this posting was helpful. if this is an answer to your question, please mark it. http://bifase.blogspot.com | http://twitter.com/atharky
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 4:06am
May seem like an obvious question but...what's the error message?http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
November 22nd, 2010 4:19am
Error Message is:
[Data Conversion [412]] Error: Data conversion failed while converting column "SSN" (50) to column "Copy of SSN" (426). The conversion returned status value 4 and status text "Text was truncated or one or more characters had no match in the target
code page.".
[Data Conversion [412]] Error: The "output column "Copy of SSN" (426)" failed because truncation occurred, and the truncation row disposition on "output column "Copy of SSN" (426)" specifies failure on truncation. A truncation error occurred on the specified
object of the specified component.
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 4:31am
How do i use the substring.
For eg the column in source is SSN with lenght 10
and the same column in destination is 9.
Im trying it out using a derived column component. Can you help me out..?
November 22nd, 2010 4:36am
Hi,
Try
SUBSTRING(SourceColumnName, 1, 9)Vctor M. Snchez Garca (ES) (BI) Hope this help. Please vote if you find this posting was helpful. if this is an answer to your question, please mark it. http://bifase.blogspot.com | http://twitter.com/atharky
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 4:44am
It got executed, but i get the warning..it should not be a problem i guess :)
November 22nd, 2010 6:09am
HI, maybe because the column leaves a len of 10 instead 9.
To fix it try: (DT_WSTR,9)SubString(SourcecolumnName,1,9)
Regards!Vctor M. Snchez Garca (ES) (BI) Hope this help. Please vote if you find this posting was helpful. if this is an answer to your question, please mark it. http://bifase.blogspot.com | http://twitter.com/atharky
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 7:42am