BUG: BCP Will Not Load Native File if First Two Bytes Are 0xFEFF (248265)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q248265
BUG #: 55559 (SQLBUG_70)

SYMPTOMS

When using BCP to insert data from a native format data file file with the "-n" command line parameter, there is a small chance that you may receive the following error message:
Invalid '-c' option on UNICODE input file: C:\DATA.BCP

CAUSE

A file may be flagged as a Unicode text file if the first two bytes in the file are 0xFEFF (hexadecimal). If the first two bytes in a native format BCP input file happen to be FE FF, the SQL Server 7.0 version of BCP assumes the input file is Unicode even though the "-n" command line parameter was specified.

WORKAROUND

You can use the T-SQL BULK INSERT command instead of BCP.exe to avoid this problem. Alternatively, modify or recreate the data file (by reordering the rows in the file, for example) so that the first two bytes of the file are not FE FF.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug KB248265