How to export SQL Server 2005 query to CSV

后端 未结 13 2672

I want to export some SQL Server 2005 data to CSV format (comma-separated with quotes). I can think of a lot of complicated ways to do it, but I want to do it the right<

13条回答
  •  难免孤独
    2020-12-04 16:01

    I had to do one more thing than what Sijin said to get it to add quotes properly in SQL Server Management Studio 2005. Go to

    Tools->Options->Query Results->Sql Server->Results To Grid

    Put a check next to this option:

    Quote strings containing list separators when saving .csv results

    Note: the above method will not work for SSMS 2005 Express! As far as I know there's no way to quote the fields when exporting results to .csv using SSMS 2005 Express.

提交回复
热议问题