Solved

SSIS error when loading a csv file

Posted on 2015-02-06
5
247 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:SimonAdept
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

747 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

13 Experts available now in Live!

Get 1:1 Help Now