Exporting data from SQL Server Express to CSV (need quoting and escaping)

后端 未结 10 1952
执笔经年
执笔经年 2020-12-05 04:16

I\'ve spent 2 days trying to export a 75,000 row table containing a large text field of user input data from a SQL server installation. This data contains every plain ascii

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 04:53

    Robert Calhoun's solution did not work for me. We had a lot of text with commas and carriage returns / newlines etc. We used the Export functionality with a few changes to Chris Christodoulou's solution above.

    In SQL Management Studio, right click the database and select Tasks -> Export Data.

    Then choose SQL Server as the source and Flat File as the destination. Name the file MyFile.csv.

    Set the Text qualifier as "

    Select 'Write a query to specify the data transfer' and paste in your query. You can leave the next settings as the defaults.

    With the data exported, open with Excel and save in the Excel format.

提交回复
热议问题