Solved

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

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now