?
Solved

SSIS error when loading a csv file

Posted on 2015-02-06
5
Medium Priority
?
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 27

Accepted Solution

by:
Zberteoc earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

764 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