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.
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.


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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Pivot table 2 53
What Is an Error? 2 59
Need quicker response from an Execption table 11 45
T-SQL: need to reset a declared variable 4 31
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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