Does SSMS have an 'Include COlumn Names in Results' Option for the Query Tool

  • I swear I thought I either read about this or had seen it implemented but darned if I can find it now. I often take the results from a query in SSMS (done to the Grid output) and dump them into Excel for sorting operations so I don't bogg down my server just to sort the data a different way. One of the annoyances is with not being able to copy and paste the column headers or column names when I copy the results.

    Is there any way in SSMS to have the first row in the result set contain the column names or column aliases when the output format is Grid?

    Thanks

    Kindest Regards,

    Just say No to Facebook!
  • You can do this 2 ways. The first way will make it apply to all query windows.

      1. In SSMS go to Tools -> Options then to Query Results -> Results to Grid and check "include column headers when copying or saving results".

      2. In SSMS with a query window open go to Query -> Query Options then to Results> Grid and check "include column headers when copying or saving results".

  • yep it sure does: Tools>>Options

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • YSLGuru (9/24/2008)


    I swear I thought I either read about this or had seen it implemented but darned if I can find it now. I often take the results from a query in SSMS (done to the Grid output) and dump them into Excel for sorting operations so I don't bogg down my server just to sort the data a different way. One of the annoyances is with not being able to copy and paste the column headers or column names when I copy the results.

    Is there any way in SSMS to have the first row in the result set contain the column names or column aliases when the output format is Grid?

    Thanks

    In the top menu go to Tools then options. In the window that opens go to the tree control on the left side. Pres on “Query Results” then “SQL Server” and “Reslts to Grid”. On the right side of the window check the checkbox – “Include column headers when copying or saving the results”

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Ahhh, I was first by seconds. Probably because I didn't provide the screen shot.

  • your too fast for me...once a path gets too many levels deep, i like screenshots too.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yeah, I like screen shots too, but the OP sounded capable enough to find it without the screen shot. Usually if I'm wrong I do screen shots in post #2.

  • Big thanks to all! I knew I remembered seeing it somewhere.

    Kindest Regards,

    Just say No to Facebook!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply