Skip to content Skip to sidebar Skip to footer

Bcp Import Error "invalid Character Value For Cast Specification"

All I am using BCP for import export and getting 'Invalid character value for cast specification' error for only 1(first row of export) row while trying to import back. Table Str

Solution 1:

I am using BCP for import export and getting "Invalid character value for cast specification" error for only 1(first row of export) row while trying to import back.

Does the first row of your export file contain column definition information?

If so, use -F2.

https://docs.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-ver15#F

Solution 2:

When using -w option, I believe BCP ignores any -t or -r option and uses \t and \n and field and row terminators.

From MS docs:

-w Performs the bulk copy operation using Unicode characters. This option does not prompt for each field; it uses nchar as the storage type, no prefixes, \t (tab character) as the field separator, and \n (newline character) as the row terminator. -w is not compatible with -c.

Post a Comment for "Bcp Import Error "invalid Character Value For Cast Specification""