Solved

SSIS error when loading a csv file

Posted on 2015-02-06
5
257 Views
Last Modified: 2016-02-15
Error when loading a CSV file in SSIS And Sql import export and import wizard


Hi experts, I am trying to load a csv file in the data flow task using the flat file connection and destination as OLEDB, this is the error I get, I tried increasing the field lengths but doesn't help, am trying to use derived columns but doesn't let me change the datatypes, please help

  " could not be processed because more than one code page(65001 and 1252) are specified for it"

 I tried to load the file using the sql server export and import wizard and here are the errors:
 Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Column 2" 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 "Column 2" (18)" failed because truncation occurred, and the truncation row disposition on "output column "Column 2" (18)" 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\shlab\Desktop\Huction.csv" on data row 1.
  (SQL Server Import and Export Wizard)
 
 Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Source - Huction_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)
0
Comment
Question by:sqlcurious
5 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40595510
I'd suggest you first try a different CSV file as the flat file datasource to see if you still get the same error.

Have you tried the simplest possible import (to a new rather than existing table)?
0
 
LVL 26

Accepted Solution

by:
Zberteoc earned 500 total points
ID: 40595743
The import wizard by default will give a size of 50 to varchar columns if in the first 8 rows they are not bigger. What you need is to manually set the column sizes in the wizard to the same as in the target table. It is one in the import steps where you can see Columns in the left panel. If you select that you will see the details about each column in the right panel, including the size. You will have to edit that.
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40595762
Error code 4 is almost always that your incoming data is too wide for your target destination. If you're sure that all your fields should be 8 characters wide, say, and you get this, then try using a target with all fields 400 characters wide, for instance, and, if it imports ok into that, use SQL to find the bad records and repair them. You can then move the cleaned data to where it should end up and complain to the people providing it!

Good luck

Mike
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 40597747
If  your csv/excel file has less no of character in initial rows for column and then after rows hiegher not of characters then SSIS automatically sense length from initial rows.

so here you have workaround; Change registry information as specified in below link

http://support.microsoft.com/kb/281517
0
 

Author Closing Comment

by:sqlcurious
ID: 40606716
Thanks and also I had to set the code page to 65001
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

919 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

15 Experts available now in Live!

Get 1:1 Help Now