Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

10777- Error: Data Flow Task at 0xC02020A1, Flat File Source [30]: Data conversion failed

Posted on 2014-10-02
5
Medium Priority
?
805 Views
Last Modified: 2014-10-06
I have a text file generated SAP, all columns of type string must move to the data type DT_WSTR, I can explain why?

If I do the following error:
Error: Data Flow Task at 0xC02020A1, Flat File Source [30]: Data conversion failed. The data conversion for column "country" returned status value 4 and status text "Text was truncated or one or more characters HAD no match in the target code page.".
Error: Data Flow Task at 0xC020902A, Flat File Source [30]: The "Flat File Source.Outputs [Flat File Source Output] .Columns [country]" failed Because truncation occurred, and the truncation row disposition on "Flat File Source. Outputs [Flat File Source Output] .Columns [country] "specifies failure on truncation. A truncation errors occurred on the specified object of the specified component.
0
Comment
Question by:enrique_aeo
  • 3
  • 2
5 Comments
 
LVL 52

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 2000 total points
ID: 40359210
DT_WSTR? Are you working with a SSIS package?
I couldn't realize if you are importing data from text file to a database but if so then the COUNTRY column must be NVARCHAR type and need to have enough length to receive the data from the text file.
0
 

Author Comment

by:enrique_aeo
ID: 40359421
i am using SSIS,
that the data type must be NVARCHAR?
cliente-direccion-err.csv
0
 
LVL 52

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 2000 total points
ID: 40359426
Yes, it should.
This should be the relation from SSIS data type to MSSQL data type:
DT_WSTR --> NVARCHAR
DT_STR -----> VARCHAR
0
 

Author Comment

by:enrique_aeo
ID: 40359439
it is a rule ?:
when we have a kind of text data in a flat file; then in the database I create a data type NVARCHAR
0
 
LVL 52

Accepted Solution

by:
Vitor Montalvão earned 2000 total points
ID: 40359449
No rule. It depends on which datatypes are you using. I'm just giving you the equivalence between SSIS and MSSQL.
You can even use numeric datatype if you are sure that the text file have only numbers for that column. The same for date and time datatypes.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question