how to get your results from a query into xls With field headers?

  • how to get your results from a query into xls With field headers?

  • if you mean when you copy and paste from Management Studio to Excel, it's an option you'll want to turn on:

    did you mean something else?

    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!

  • Yes

  • Yes = You meant something else?

    or

    Yes = That was the solution i was looking for?

    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!

  • You could do something like this:

    Select 'Name' As myColumn1, 'Address' As myColumn2

    Union

    Select myColumn1, myColumn2

    From myTable

    Where blah, blah

    Basically the first query is just doing a SELECT of all the column names in the underlying table.

  • If you can get your hands on the 2008 tools there is a Copy With Headers option in the right-click context menu.

  • I did not ask this question but thanks for this. It was on my ' I wonder where that is. I must make time to look.......' list

    🙂

    Madame Artois

Viewing 7 posts - 1 through 6 (of 6 total)

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