Home Dashboard Directory Help
Search

Embedded text qualifier does not conform to RFC 4180 during export to CSV by esivasankar


Status: 

Active


11
0
Sign in
to vote
Type: Bug
ID: 778980
Opened: 2/11/2013 10:14:11 AM
Access Restriction: Public
1
Workaround(s)
view
1
User(s) can reproduce this bug

Description

RFC 4180 defines Common Format and MIME Type for Comma-Separated Values (CSV) Files. One of the requirements of the RFC 4180 is stated below. SQL Server 2012 Import and Export wizard does not conform to the below stated requirement when exporting data to CSV file. Attached PDF file contains detailed steps to simulate and compare the output between SQL Server 2000 and SQL Server 2012.

RFC 4180 states the following:

If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example:
"aaa","b""bb","ccc
Details
Sign in to post a comment.
Posted by Microsoft on 4/2/2014 at 8:00 PM
Hello
Thank you for submitting this feedback. After carefully evaluating all of the bugs in our pipeline, we are closing bugs that we will not fix in the current or future versions of SSIS. The reasons for closing these bugs are following:
1.     The fix is risky to implement in the current version of the product
2.     Scenarios reported in the bug are not common enough
3.     A viable workaround is available.

If the issue is a critical business interruption, please call CSS (Customer Support Services).

Thanks again for reporting the product issue and continued support in improving our product.

Mariusz Cichomski
Program Manager
Microsoft
Sign in to post a workaround.
Posted by esivasankar on 2/11/2013 at 10:26 AM
To overcome the issue in SQL Server 2012 Import and Export Wizard for the above given example, I can ignore selecting the table and use the below query where it would replace all double quotes (") in the column data with two double quotes ("") in order for the generated CSV file to conform with RFC 4180. This provides the same output as the file created by SQL Server 2000 DTS Export/Import Wizard.

SELECT ItemId, REPLACE(ItemDesc, '"', '""') AS ItemDesc FROM dbo.ItemInformation
File Name Submitted By Submitted On File Size  
SQL_Server_Bug_778980.pdf 2/13/2013 692 KB