dawntrader
dawntrader

Reputation: 775

Exporting SQL Server data to CSV

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.

Upvotes: 2

Views: 4115

Answers (2)

theKing
theKing

Reputation: 1636

Use QUOTENAME if y ou want double quotes around fields

Link to quotename

Upvotes: 0

Lukasz Lysik
Lukasz Lysik

Reputation: 10610

Use bcp utility.

Example here.

Upvotes: 3

Related Questions