I's like to see output like this:
" 123 1st Street", "Los Angeles," , "CA", "90001", "next column,
etc."
This is assuming that you want non-string fields enquoted? You can use
""",""" as the delimiter, but you are going to have problems with the quote
before the first field, therefore it may be easier to use a query to export
the data and include the delimiters where needed as literal strings.
John
"Eric" <er...@nospam.com> wrote in message
news:uqypUdq7...@TK2MSFTNGP10.phx.gbl...
You will need to use a format file where you specify the delimiter for
each column. A sample:
8.0
7
1 SQLCHAR 0 0 "\"" 0 "" ""
2 SQLCHAR 0 0 "\",\"" 2 col2 ""
3 SQLCHAR 0 0 "\",\"" 3 col3 ""
4 SQLCHAR 0 0 "\"," 4 col4 ""
5 SQLCHAR 0 0 "," 5 col5 ""
6 SQLCHAR 0 0 "." 6 col6 ""
7 SQLCHAR 0 0 "\n" 0 "" ""
In this format file, the first column in the host file is an empty
field, which is only there to leave place for a " before the first
column. That's why there is a 0 in the sixth column.
This format file will enclose the three first columns in the file in
quotes, the last two will be unquoted. The last column will be terminated
by a period for some reason. (This was a file that I happened to have
lying on disk.)
Note also that the column names in the format file are informative only.
What matters is the column number in the sixth column.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp