Can anyone clue me in on how to get bcp to output quoted, comma-separated
values
"Bob",50,"Kansas"
"Leslie",44,"California"
etc
thanks ...Hi
Just using the -r and -t options to produce quotes will miss the first set
of quotes on each line.
You can try something like:
bcp "SELECT
'\" '+au_id,au_lname,au_fname,phone,address,
city,state,zip,contract FROM
Pubs.dbo.authors" queryout authors.txt -T -t"\",\"" -r"\"" -c
or use the Bulk Export task and DTS:
http://www.sqldts.com/default.aspx?272
John
"Liz" <liz@.tiredofspam.com> wrote in message
news:OvIT7vYKEHA.2244@.tk2msftngp13.phx.gbl...
> Can anyone clue me in on how to get bcp to output quoted, comma-separated
> values
> "Bob",50,"Kansas"
> "Leslie",44,"California"
> etc
> thanks ...
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:seiic.495$mG1.3946694@.news-text.cableinet.net...
> You can try something like:
> bcp "SELECT
> '\" '+au_id,au_lname,au_fname,phone,address,
city,state,zip,contract FROM
> Pubs.dbo.authors" queryout authors.txt -T -t"\",\"" -r"\"" -c
thank you; it's so convoluted it almost seems they don't want you to do this
.. BUT it works
> or use the Bulk Export task and DTS:
> http://www.sqldts.com/default.aspx?272
interesting ...
> John
> "Liz" <liz@.tiredofspam.com> wrote in message
> news:OvIT7vYKEHA.2244@.tk2msftngp13.phx.gbl...
comma-separated[vbcol=seagreen]
>|||Hi
If you wish for a feature to be added to SQL Server you may want to suggest
it by emailing:
sqlwish@.microsoft.com
John
"Liz" <liz@.tiredofspam.com> wrote in message
news:O5ckPlZKEHA.808@.tk2msftngp13.phx.gbl...
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:seiic.495$mG1.3946694@.news-text.cableinet.net...
>
> thank you; it's so convoluted it almost seems they don't want you to do
this
> .. BUT it works
>
> interesting ...
>
>
> comma-separated
>
没有评论:
发表评论