SQL Server Home
Exporting CSV cannot handle commas/quotes in strings!
as Not Reproducible
1/14/2011 12:50:09 AM
User(s) can reproduce this bug
When saving 'select' result to csv file, SSMS does not handle commas/quotes in string values! It's bad.
SQL Server 2008 R2 - Express Edition
Tools (SSMS, Agent, Profiler, Migration, etc.)
Windows XP Professional
Operating System Language
Steps to Reproduce
1. Start SSMS.
2. Run a select query against any table that have rows containing comma or quotes.
3. 'Save as' the result.
Commas and quotes are not escaped!
It should escape commas and quotes.
to post a comment.
Please enter a comment.
on 4/19/2011 at 6:05 AM
It's amazing... It works, but these options should be enabled by default.
on 4/19/2011 at 3:43 AM
Greetings from the SQL Server Manageability team.
Thanks for writing in to Microsoft. We greatly value your feedback.
We have an option in SSMS which can take care of the issue reported by you, when data contains comma/quotes.
Right Click on TSQL Editor -> Query Options -> Results and check the option
"Quote strings containing list separators when saving .csv results".
Tools -> Options -> Query Results -> SQL Server -> Result to Grid
check the option "Quote strings containing list separators when saving .csv results"
(Effect will take place on TSQL editors that are opened after this option is selected)
In case you some other concern, feel free to reactivate this defect.
Thanks again for providing feedback and making SQL Server the greatest Database server.
on 3/24/2011 at 1:11 AM
If you cannot fix this, please remove this feature. Without correct handling of commas and quotes, it's almost useless to export CSV!
to post a workaround.
Please enter a workaround.
© 2014 Microsoft