February 6, 2005 at 11:27 pm
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!!!
February 6, 2005 at 11:36 pm
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
February 7, 2005 at 1:57 am
You could also do an export (defined by a query) directly to Excel.
/HL
February 8, 2005 at 2:16 am
an export to Excel defined by a query ....?
Please enlighten me maybe we're calling the same thing a rose?
February 8, 2005 at 7:16 am
QueryToDoc (http://www.querytodoc.com) will export query results (including column headings) to a table in a Word document.
February 8, 2005 at 10:20 am
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!!
February 8, 2005 at 10:50 am
don't forget that you can make an external datasourse in excel and just run the query. makes the data live.
tal
February 8, 2005 at 10:55 am
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
February 10, 2005 at 12:55 pm
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