Nemo
Nemo

Reputation: 1111

Import Issue with a csv file into SQL Server 2008 table

I'm using SQL Server Import and Export wizard to import data from a csv file to append to my already existing SQL Server table.

So, to append data from a csv file to my SQL Server table, in Choose a Data Source window, I'm making sure that each column in my csv data source has equivalent data type as that of my SQL Server table columns.

However, I always end up getting error while doing import.

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Maturity(Hours)" returned status value 2 and status text "The value could not be converted because of a potential loss of data.". (SQL Server Import and Export Wizard)

Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "Maturity (Hours)" (42)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "Maturity(Hours)" (42)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)

My SQL Server table has Maturity (hours) as int datatype.

For my csv file, in SQL Server Export/Import wizard, I'm selecting DT_I4 for Maturity (hours), which is equivalent to int data type in SQL Server. Still I couldn't get rid of that error for the past 3 hours.

Any clue on how to resolve this issue?

Upvotes: 0

Views: 2426

Answers (1)

Maximus
Maximus

Reputation: 802

Just have a look in the csv file if any field has any commas (in case if you used comma as column separator or double quotes (in case if you used double quotes as text qualifier). Your problem should come under the above 2 scenarios.

Note: I put this as answer as I could not comment on your question.

Upvotes: 0

Related Questions