Solved

error importing csv to sql

Posted on 2010-08-17
2
409 Views
Last Modified: 2012-08-14
Hi.

I am trying to import a csv into SQL 2008 and i get the following error:

Executing (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Mailing Street" 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 1: The "output column "Mailing Street" (98)" failed because truncation occurred, and the truncation row disposition on "output column "Mailing Street" (98)" 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 1: An error occurred while processing file "C:\Users\tanvi\Documents\Fusion\database\salesforce\report1282048903904_test.csv" on data row 3.
 (SQL Server Import and Export Wizard)
 
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Source - report1282048903904_test_csv" (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)

please help as i have no idea what this means.
0
Comment
Question by:oldtedt
2 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 250 total points
ID: 33454937
Looking at the error, All i can say is a truncation occurred on the Mailing Street Column, that is The length of the values in that particular column are more than the length of your Destination ie.,SQL Server Table Column

I would suggest you to check the Length of the column in both source and destination, If possible increase the length of your destination column

Check the Value of the Mailing Street Column in 3rd row of the file report1282048903904_test.csv
0
 

Author Comment

by:oldtedt
ID: 33456321
Thanks for that. it was a trucation problem, difference in the size of source and destinatation. this error occured for various other fields as well since sql import takes a default size of 50. I just changed all sizes to 1000. Also the surprising bit was i got the same error for a date value in source file. i had to increase that to 1000 as well!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

820 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