With SQL Server 2008 R2, when I save the results as a CSV there are no headers. I can work around this by copying and pasting with the "Copy with Headers" , or just grab the headers and paste them in the CSV etc, but is there a better way to do this?
Sql-server – Save Results as CSV *with* headers in SSMS
csvsql serversql-server-2008-r2ssms
Related Question
- Postgresql – Copying CSV file to temp table with dynamic number of columns
- SSMS 2012 CSV exports
- SSMS – How to Import Data from Flat File (.csv)
- SSMS – Prevent Tab to Space Conversion When Copying Text
- SQL Server SSMS – Save Results As CSV for Excel
- SQL Server Agent – Hide Job Step Details and Column Headers in Output File
- How to Import Daily CSV with Varying Headers in SQL Server
Best Answer
In SSMS you need to change some options:
Tools - Options - Query results - sql server - results to grid (or text) -> Include column headers when copying or saving the results.
Changed settings are applied to new, but not existing query windows.