BCP with Double Quotes for OUTPUT FilePosted: December 19, 2013
----bcp OUT with double quote around text type columns and ignore number columns exec master..xp_cmdshell 'bcp "select id, char(34)+col1+char(34), char(34)+col2+char(34), char(34)+col3+char(34) from [yourDB].[dbo].[yourtable]" QUERYOUT "C:\temp\yourFile.txt" -T -c -t, -b 100 -S serverName\DBInstance'; go
I have to add to this if you can use SSIS package (Simply Import/Export Wizard from SSMS). You can simply add a Text Qualifier through flat file connection setting with a double quote when you export your table to a CSV file. That is simple.