SQL Server BCP: How to put quotes around all fields?

前端 未结 7 1198
星月不相逢
星月不相逢 2021-02-08 22:01

I have this BCP command:

\'bcp DBName..vieter out c:\\test003.txt -c -T /t\"\\\",\\\"\" -S SERVER\'

The output CSV I get does not put quotes ar

7条回答
  •  天命终不由人
    2021-02-08 22:20

    bcp "SELECT char(34) + * +char(34) FROM atable queryout "C:\temp\out.csv" -T -N -c /t"\",\""
    

    This will put quotes before and after each field (including the first and the last).

提交回复
热议问题