[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

SSIS error when loading a csv file

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
sqlcurious
Asked:
sqlcurious
1 Solution
 
SimonCommented:
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
 
ZberteocCommented:
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
 
DcpKingCommented:
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
 
Alpesh PatelAssistant ConsultantCommented:
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
 
sqlcuriousAuthor Commented:
Thanks and also I had to set the code page to 65001
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now