BUG: BCP Fails to Parse Format File If It Has Space in Col. Name

Last reviewed: January 23, 1998
Article ID: Q179657
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5
BUG #: WINDOWS: 17758 (6.5)

SYMPTOMS

When using the bulk copy program (BCP) to do BCP IN, BCP fails to parse a format file that was created during a BCP OUT. This problem occurs when the user responds to the prompts for each column if the source table was created with white space in the column names.

CAUSE

When a table is created with the SET QUOTED_IDENTIFIER option turned on and the table columns have embedded white space, the column names with the embedded white space are copied to the last column (column name) of a format file by BCP. On a BCP IN, these column names are incorrectly parsed because of the white space. The following error message is returned by BCP:

   DB-LIBRARY error:
   Incorrect host-column number found in bcp format-file.

This error is generated because BCP stops parsing the column name after it encounters the first white space. BCP then interprets the next word in the column name as the beginning of the next line and expects to find a column number for the data file.

WORKAROUND

To work around this problem, manually edit the format file to omit all white space characters from the last column in the format file (that is, characters 0x09-0x0D, 0x20).

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: tbl
Keywords : kbbug6.00 kbbug6.50 SSrvBCP
Version : WINNT:6.0 6.5
Platform : winnt
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 23, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.