Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (20.3k points)

I am using SQL Server Management Studio.

I wish to save the results of a query to an excel file.

I choose "save as" and then save to CSV file which I can open in excel. All good except I am missing column headers, any ideas how I get them exported?

1 Answer

0 votes
by (40.7k points)

Follow these steps:

Step 1: Go to Tools > Options 

Step 2: Select Query Results 

Step 3: Go to SQL Server 

Step 4: Choose Results to Text (or Grid if you want) & Include columns headers in the result set

Note: If you want to close and reopen SSMS after changing this option. Then, just go to the SQL Editor Toolbar and select save to file without restarting the SSMS.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers


108k users

Browse Categories