The information in this article applies to:
SUMMARYThis article describes how to customize the bulk copy program (BCP) format file to strip off unwanted quotation marks around the character strings in the data file. MORE INFORMATION
You can customize the BCP format file to strip off quotation marks that
surround character strings in your ASCII data file. This process requires
modifying the terminators to include a backslash and quotation mark (\") to
interpret the quotation mark as a literal. If the first field in the data
file is within quotation marks, you must add a new line to the BCP format
file to dispose of the first quotation mark.
Example 1For the data file:"XX","BB","CC" "TT","QA","RD" When all of the columns have a character data type, and the data is in quotation marks, use the following BCP-format file (BCP.FMT):
Example 2For the data file:"XX",20,"CC" "TT",30,"RD" When the second column is type integer, the remaining columns have a character data type, and the data is in quotation marks for the character data type. Use the following BCP-format file:
Note the exact column delimiter for the dummy variables in both the examples. The first line of the BCP.FMT refers to the version of the BCP utility. When running either version 1.1 or 1.11 of BCP, this value is 4.0. In SQL Server version 4.2, this value is 4.2. In SQL Server version 6.0, this value is 6.0. In SQL Server version 6.5, this value is 6.0. For similar examples with Microsoft SQL Server version 4.2, please see the following article(s) in the Microsoft Knowledge Base: Q73182 : INF: Using BCP When Data Is Within Quotation Marks Additional query words: sql6 quotes Windows NT
Keywords : kbtool SSrvBCP SSrvWinNT |
Last Reviewed: April 15, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |