Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-05-31
3
Medium Priority
?
1,903 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
[X]
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
  • 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 2

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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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