Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 error with Bulk Insert

Author  Topic 

ironmonkey
Starting Member

8 Posts

Posted - 2010-10-18 : 17:33:03
I'm getting the following error when I run the following Bulk Insert statement. All columns in my table are type nvarchar(50).

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 8 (Units).
Msg 4864, Level 16, State 1, Line 1

This is the SQL statement:


BULK INSERT table_tbl
FROM 'C:\TEMP\textfile.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)


textfile.csv:

001_IL0001234_50050,IL0001234,MPE Station 1,1,001 - Wastewater Treatment System,50050,"Flow, in conduit or thru treatment plant ",3,Mgal per d ,1-Jan,Daily,Continuous,CN,CONTIN,10,,,,,,,,,,,,,,,,"FLOW, IN CONDUIT OR",THRU TREATMENT PLANT,50050,Effluent Gross,Calculate,Calculate,Arithmetic,1,N/A,N/A,N/A,,,C,1

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-10-19 : 13:03:21
are you sure the datatypes in file corresponds to datatypes of fields in table? Also check is delimiter is consistent

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -