Microsoft KB Archive/248265

From BetaArchive Wiki
Knowledge Base

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

Article ID: 248265

Article Last Modified on 10/16/2002


  • Microsoft SQL Server 7.0 Standard Edition

This article was previously published under Q248265

BUG #: 55559 (SQLBUG_70)


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


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.


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.


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

Additional query words: FEFF

Keywords: kbbug kbpending KB248265