How to modify the File/Save Results As menu setting so that the resulting file contains the column headers?

Beverly Penney
Beverly Penney used Ask the Experts™
on
Hi There,

I wanted to know if it was possible to somehow modify the settings for the  "File/Save Results As"  menu so that the resulting csv includes the column headers? I know you can do it by just selecting all  then "Copy with headers" but was interested to know if it could be done the other way as well?

Thanks,
Rhonda
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010
Commented:
Tools - Options - Query Results - Sql Server - Results to Grid - Include column headers when copying or saving results.  

http://aspadvice.com/blogs/ssmith/archive/2007/12/01/Save-SQL-Query-Results-With-Column-Names.aspx

In SQL 2008:
http://blogs.msdn.com/b/varund/archive/2009/04/10/how-to-copy-column-header-in-sql-management-studio-2008.aspx

Author

Commented:
Hi om_prakash_p ,

I already had the option checked in the Tools menu (the first link you included) but still when I go
File/Save Results As ( I save it as a csv) it isn't including the headers, is there anything else I should check?

R
Top Expert 2012

Commented:
>>is there anything else I should check?<<
Unfortunately, there is no option to set the column headers when the output is set to file.  You will have to find some other way of doing it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial