INF: Using BCP When Data is in Quotation MarksID: Q132463
|
This 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.
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.
This example explains how to use BCP in the data file to exclude the
quotation marks:
4.2
7
1 SYBCHAR 0 0 "\"" 0 dummy1
2 SYBCHAR 0 2 "\"" 1 col1
3 SYBCHAR 0 0 ",\"" 0 dummy2
4 SYBCHAR 0 2 "\"" 2 col2
5 SYBCHAR 0 0 ",\"" 0 dummy3
6 SYBCHAR 0 2 "\"" 3 col3
7 SYBCHAR 0 0 "\r\n" 0 dummy4
4.2
7
1 SYBCHAR 0 0 "\"" 0 dummy1
2 SYBCHAR 0 2 "\"" 1 col1
3 SYBCHAR 0 0 "," 0 dummy2
4 SYBCHAR 0 2 "," 2 col2
5 SYBCHAR 0 0 "\"" 0 dummy3
6 SYBCHAR 0 2 "\"" 3 col3
7 SYBCHAR 0 0 "\r\n" 0 dummy4
Q73182 : INF: Using BCP When Data Is Within Quotation Marks
Additional query words: sql6 quotes Windows NT
Keywords : kbtool SSrvBCP SSrvWinNT
Version : 4.21a 6.0 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: April 15, 1999