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 2005 Forums
 SSIS and Import/Export (2005)
 Flat file importing error

Author  Topic 

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-01-20 : 15:07:51
I'm getting
Error: 0xC02020A1 at Data Flow Task, Source - LIVE_ITMMST_txt [1]: Data conversion failed. The data conversion for column "Description" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

I understand what it means and I've changed field sizes but with no luck. Here is a sample of the description data -
DSB BAR EXTRUSION 36.51 BLK [42] REV. F [RoHS]

That's exactly how it is on the flat file, is it the [ ] that is messing up the import?

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-01-20 : 15:52:23
It's not the [ ]. I tried taking them out and still get the same error.
Go to Top of Page

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-01-20 : 16:02:34
It's the spaces between the words. In the description there are 10 to 15 spaces between the words. I removed the spaces and I was able to import. Now how do I remove all the spaces and then add a space so the words don't run together. There are about 10,000 rows in the file.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-20 : 16:15:24
What field terminator are you using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-01-20 : 16:27:41
It's a tab. The file is an extract from an ERP system.
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-01-20 : 18:39:10
well you might do that now and tomorrow there is a change in your extract and you are right back (the requirements never change..of course)
why not fix it at the source ..meaning at the extract..change the extract process, if you can, so that it spits out what you want.

2 cents
Go to Top of Page

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-01-21 : 10:56:28
The data from the extract is the problem. It's coming from a sister company's ERP system and the way they entered the data is causing the issue. For some reason they put a ton of spaces between some words. I have no idea what their reasoning was behind it. So for the time being I have to deal with what I can get. I just tried importing the data into an excel sheet to see if that worked and I still get the same error about the description field.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-21 : 11:18:07
try using ssis package and use derived column task to remove spaces from values
Go to Top of Page
   

- Advertisement -