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

ID: Q248265


The information in this article applies to:
  • Microsoft SQL Server version 7.0

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 version 7.0.

Additional query words: FEFF

Keywords : SSrvBCP kbSQLServ700bug
Version : winnt:7.0
Platform : winnt
Issue type : kbbug


Last Reviewed: January 27, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.