Query Analyzer Results - Print with headings?????

  • Environment.

    SQL2k  on Win2k server

    I have a script that gives me the results I want.  Now I want to print it.

    Easy way to do it is to cut and paste into excel, but I loose the headings.

    I know it has to be an easy way to get print the results with the headings.

    Any ideas... will be greatly appreaciated!!!

     

  • In Options on the Results tab, choose "Results to Text" and "Tab Delimited". This will give you the headings and data that you can cut & paste straight into Excel. Also, make sure you have SET NOCOUNT ON or you will have the "XXX rows..." message at the bottom.

    Another tip, if you run your query in the Query Designer within EM, cutting and pasting from the results grid includes the column headings.

     

    --------------------
    Colt 45 - the original point and click interface

  • You could also do an export (defined by a query) directly to Excel.

    /HL

  • an export to Excel defined by a query ....?

    Please enlighten me maybe we're calling the same thing a rose?

     

     

  • QueryToDoc (http://www.querytodoc.com) will export query results (including column headings) to a table in a Word document.

  • That look like a cool tool.

    But for what I needed. Saving as text and tab delimeter did the trick for this one (maybe two) times deal.

    If the request moves into a more regular basis, then I will look into these tools.

    Thanks for your great help.

    PS.

    Now you got me looking!!

  • don't forget that you can make an external datasourse in excel and just run the query.  makes the data live.

     

    tal

  • Excel has some very cool ways of working with SQL Server.  You could even connect and query utilizing a VBA script that runs when you load the spreadsheet.  That is one of the great advantages of using the Microsoft Office Suite of programs.  They all support VBA which enables you to manipulate and develop all sort of reports.

     

    Marvin

    Marvin Dillard
    Senior Consultant
    Claraview Inc

  • Great tip Phill!  We have been working with SQL Server for years and never thought of doing this.  I just shared with my team.  Thanks!

    [font="Courier New"]ZenDada[/font]

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

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