Question

I have a data file that contains a datetime field in (yyyy mm dd) format. I have created a bcp format file to import the data but when run the statement, I get an error Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 16 (ReleaseDate).

How can I tell the bcp utility to treat the field in (yyyy mm dd) format or convert the format to that sql server expect ?

Was it helpful?

Solution

I have two comments on the problem.

First, make sure you are using a ASCII code page, not UNICODE which is two bytes.

Second, if BCP is having issues you can play around with the format file.

If that does not work, change from ETL to Extract Load Translate (ELT).

Bulk load from file to a varchar() column in a table. Translate with a stored procedure to the right data type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top