2

What’s the quickest way to export SQL Server data to CSV with ALL column fields enclosed in double quotes, including numeric fields?

In the Results window of Management Studio, I can right click and choose “Save Results to CSV” but it doesn’t enclose fields in double quotes.

I have looked into similar questions but the solutions proposed does not do what I want.

Community
  • 1
  • 1
dawntrader
  • 765
  • 2
  • 11
  • 19

2 Answers2

3

Use bcp utility.

Example here.

Lukasz Lysik
  • 10,462
  • 3
  • 51
  • 72
0

Use QUOTENAME if y ou want double quotes around fields

Link to quotename

theKing
  • 1,616
  • 4
  • 18
  • 23