How to get export output in “real” CSV format in SQL Server Management Studio?

前端 未结 12 1013
梦谈多话
梦谈多话 2020-12-04 07:57

I have a query that I am running in SQL Server Management Studio (connecting to a SQL Server 2005 database). I want to export the data in CSV format. Not wannabe CSV format,

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 08:47

    I would like to suggest an alternative approach. I have this question bookmarked in SO. Voted in a lot of the answers and comments. But it is always a mess when I need to do the banal task of exporting a CSV file from a query in SQL Management Studio.

    The easiest solution is to just to use another tool, the free Dbeaver.

    1. Download the Dbeaver multiplatform database tool (there is a portable version, you can use if without admin rights in your machine).
    2. Run it and create a new SQL Server connection.
    3. Open a new "Sql editor" tab
    4. Click the arrow to execute your query
    5. Right click the result grid and select "export data" and select CSV
    6. Voilá! Now you have a decently formated CSV file.

    No mystery. No need to restart. It just works.

提交回复
热议问题