Solved

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

Posted on 2013-05-31
3
1,818 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Parse this column 6 38
MS SQL Conditional WHERE clause 3 47
Database-Scoped Permissions 2 38
Any benefit to adding a Clustered index here? 4 32
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

740 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