I have a simple BCP command to query my MSSQL database and copy the result to a .csv file like this:
bcp "select fullname from [database1].[dbo].employee" queryout "c:\test\table.csv" -c -t"," -r"\n" -S servername -T
The issue comes when the fullname column is varchar separated by a comma like "Lee, Bruce". When the result is copied to the .csv file, the portion before the comma (Lee) is placed into the first column in Excel spreadsheet and the portion after the comma (Bruce) is placed in the second column. I would like it to keep everything in the first column and keep the comma (Lee, Bruce) . Does anyone have any idea how to achieve this?