Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

error importing csv to sql

Posted on 2010-08-17
2
Medium Priority
?
420 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 750 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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

824 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