?
Solved

trying to import delimited file

Posted on 2015-01-23
5
Medium Priority
?
136 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 53

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 53

Accepted Solution

by:
Vitor Montalvão earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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 article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

830 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