After exporting sql grid results (or copy and paste in Excel) - Header is missing. How do I export (or copy) the column titles?

Posted on 2008-06-23
Last Modified: 2010-04-16
After the sql query runs, when I copy and paste (or export to .csv) results in Excel - the header doesn't come with it.  How do I get the header to copy over?
Question by:glabossi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 60

Accepted Solution

chapmandew earned 500 total points
ID: 21847001
in management studio, to go tools, options, query results, sql server, results to grid...make sure the option is checked to include column headers.

Author Comment

ID: 21847058
THe funny thing is that it is already set like this?  I still can't get the headers!
LVL 60

Expert Comment

ID: 21847073've got me then.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 21847171
Darn.  Me too!  It should be obvious that that would do it but I still get no headers!  I'm in SQL 2005 Query Analyzer.
LVL 60

Expert Comment

ID: 21847205
Thats really wierd....its always worked for me....

Expert Comment

ID: 22116800
From MSSMS go to  QUERY---QueryOptions--Grid then CHECK on the 'Include column headers when copying or saving results'

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server group with two values 4 40
table joins in qry 17 83
SQL group by query to return records with highest value 6 31
How can I use this function? 3 32
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question