July 27, 2009 at 7:16 am
Can anyone tell me how I could get all my fields to be not only comma separated but quote (") delimited.
i.e.
current output
FRED,SMITH,3 THE STREET,ANYWHERE
preferred output
"FRED","SMITH","3 THE STREET","ANYWHERE"
Only sqlcmd usage allowed.
May 11, 2012 at 1:40 am
You could try and use the QUOTENAME function or add double quotes around the fields
sqlcmd -S localhost -E -Q "select '""' + [name] + '""', QUOTENAME ([number], '""'), QUOTENAME ([type], '""') from spt_values" -o "Test.csv" -h-1 -s"," –W
I have not found a way with the sqlcmd options yet.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy