SQL Server Developer Center > SQL Server Forums > SQL Server Samples and Community Projects > How do I get the headers from a SQL2005 query to excel2007
Ask a questionAsk a question
 

QuestionHow do I get the headers from a SQL2005 query to excel2007

  • Wednesday, September 02, 2009 6:33 PMjames.reeve Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    In Excel 2003 I was able to copy query results with header from SQL2005. But In Excel 2007 will not allow me to copy the query result headers to the spreadsheet. Is there a converter that I need?

All Replies

  • Saturday, September 26, 2009 3:34 PMJacob SebastianMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    If you are using SQL server 2008 SSMS, you can right click on the result grid and select 'copy with header'.
    Beyond Relational
    SyntaxHelp.com
  • Wednesday, September 30, 2009 11:02 AMVIVEK YJA Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    This can be achieved using sql serve 2008 SSMS, what you need just right click on the result panel and choose with the headers.

    Thats it.

    Hope this helps.
  • Tuesday, October 06, 2009 10:46 PMZielyn Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Clicking Tools -> Query Results -> Sql Server -> Results to Grid
    and check the box that says 'Include Column Headers when copying or saving the results'

    Maybe that got unchecked in the process somehow?

    Is this what you were looking for?