SSMS and SSDT do not escape double quotation marks when you export data as CSV

Applies to: SQL Server 2017 DeveloperSQL Server 2017 EnterpriseSQL Server 2017 Enterprise Core More

Symptoms


You export a table as a CSV file by using Microsoft SQL Server Management Studio (SSMS) or SQL Server Data Tools (SSDT). For example, you export a table into CSV format in a SQL Server Integration Services (SSIS) project.

If you select double quotation marks (") as the text qualifier, and if any records contain double quotation marks, the marks might not be escaped correctly in the output.

Example

Original data

big”data

Expected output

“big””data”

Actual output

“big"data”

Resolution


The fix for this problem is included in the following update for SQL Server:

Cumulative Update 8 for SQL Server 2017

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the standard terminology Microsoft uses to describe software updates.