Question: how to export data from sql server with headers?
Answer: Go to Tools > Options.
Navigate to Query Results > SQL Server > Results to Grid, then check “Include column headers when copying or saving the results” option:
Click OK to save changes, close and restart SSMS to apply changes.
If you use the 'Save Results As…'