?
Solved

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

Posted on 2013-05-31
3
Medium Priority
?
1,957 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 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

750 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