Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Import Text File Error: Code: 0xC02020A1, 0xC020902A, 0xC0202092

Posted on 2013-05-31
3
1,796 Views
Last Modified: 2013-06-05
HI All,

There's a SQL job that runs.  It imports a text file.  Runs every night.  This morning it throws an error.

Error Code: 0xC02020A1
"Description: Data conversion failed. The data conversion for column "Column 26" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". "

Error Code: 0xC020902A
"Description: The "output column "Column 26" (114)" failed because truncation occurred<c/> and the truncation row disposition on "output column "Column 26" (114)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component. "

Error Code: 0xC0202092
"Source: Data Flow Task Source - filename_txt [1]     Description: An error occurred while processing file "filename.txt" on data row 43. "

I cut the file down twice and successfully imported the first 217 files (out of 757).  Next I cut out the next 50 files - but came up with the same error as above.

Any ideas on this?

JS
0
Comment
Question by:jshesek
  • 2
3 Comments
 
LVL 20

Expert Comment

by:dsacker
ID: 39211177
Do you have a value in this file that is larger than the defined column length?

Either enlarge the column, reduce the field content size or simply add SET ANSI_WARNINGS OFF before you begin your import (assuming your import job is a script).
0
 
LVL 1

Author Comment

by:jshesek
ID: 39211217
I'm looking at row 43, in the text file, and the data for output column named "Column 26".  It usually contains a "Y" in the field and in SQL it's defined as nvarchar(255).  So I think that's ok.
If I look at the text file column 26, the field, looks as wide as the file above it.

Will SET ANSI WARNINGS OFF - make SQL continue adding the records after the error?
0
 
LVL 20

Accepted Solution

by:
dsacker earned 500 total points
ID: 39211222
Yes, SET ANSI_WARNINGS OFF will bypass truncation errors. If that doesn't fix your problem, another question to rule out is whether there an additional delimiter character in your data. (Obviously, this is a data issue.)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

765 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