Link to home
Start Free TrialLog in
Avatar of siva_iaf
siva_iaf

asked on

Data conversion failed - SQL Server

Hi
I have been trying to import a Text file from my system to an SQL Server Db.(2005).
I am using the Import& Export tool to do the same. One particular field is giving errror all the time as below.

**********
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "CounterpartyLongname" 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 "CounterpartyLongname" (138)" failed because truncation occurred, and the truncation row disposition on "output column "CounterpartyLongname" (138)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
 (SQL Server Import and Export Wizard)

********
CounterpartyLongname is currently stored as NVARCHAR 50.

When i looked at the flat file the maximum stored charechters in the "CounterpartyLongname" field is 95 Charechters.

Hence i changed, in teh column mappings the Data type to NVARCHAR 150, but it is still giving the same error.

Any help as to how to import this file successfully.

Regards

Avatar of siva_iaf
siva_iaf

ASKER

Screen shot of data type attached
Doc4.doc
ASKER CERTIFIED SOLUTION
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. Modified using the advanced properties of the flat file and it worked.