Solved

trying to import delimited file

Posted on 2015-01-23
5
108 Views
Last Modified: 2016-02-15
Hello! I have a tab delimited file that I am trying to import into SQL, but I cannot because of these errors below. Can anyone tell me how I can get this into SQL?

- Executing (Error)
Messages
Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "CompanyName" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
 (SQL Server Import and Export Wizard)
 
Error 0xc020902a: Data Flow Task: The "output column "CompanyName" (46)" failed because truncation occurred, and the truncation row disposition on "output column "CompanyName" (46)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
 (SQL Server Import and Export Wizard)
 
Error 0xc0202092: Data Flow Task: An error occurred while processing file "C:\Users\xxx\Desktop\file.txt" on data row 47.
 (SQL Server Import and Export Wizard)
 
Error 0xc0047038: Data Flow Task: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Source - file" (1) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
 (SQL Server Import and Export Wizard)
 
Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "SourceThread0" has exited with error code 0xC0047038.  There may be error messages posted before this with more information on why the thread has exited.
 (SQL Server Import and Export Wizard)
 
Error 0xc0047039: Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
 (SQL Server Import and Export Wizard)
 
Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread0" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
 (SQL Server Import and Export Wizard)
0
Comment
Question by:mrosier
  • 2
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Vitor Montalvão
ID: 40566646
The data conversion for column "CompanyName" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

Where the file is coming from?
What is the size of the CompanyName?
Can a record that you are trying to import be larger than that size?
This process always worked?
0
 

Author Comment

by:mrosier
ID: 40566658
it is coming in from just a tab delim. file. I am not sure as to the content of the data, but is there a field type/length I could use that should just allow anything in? We have always imported these  tab-del files before, but not this particular instance.
0
 
LVL 46

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40566662
You should verify and compare the lengths from file and table fields. If SQL Server is truncating the value is because is reading something bigger than what he can fits in that specific column.
0
 
LVL 18

Expert Comment

by:Simon
ID: 40566679
I think it's either truncating or using a wrong code page.Check code page on the import wizardTry Vitor's suggestions, but also worth checking that when you import it either shows ANSI - Latin I or UTF-8.

Sometimes formatting codes or other characters (eg. in barcode encodings) can fool the Wizard into thinking it should use some exotic code page.

You can open the file in Excel first to have a quick look at field lengths. If you're creating a new table when you import it shouldn't give you truncate errors unless you have very long strings.
0
 

Author Comment

by:mrosier
ID: 40566740
Ok so the answer turned out to be just making all the fields 255. Thanks!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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.
Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

20 Experts available now in Live!

Get 1:1 Help Now