You can export the results from the grid in Query Analyzer in the following ways:
1. Right click and choose "Save As". Your results will be saved as a CSV file.
2. Right click and choose "Select All" then choose "Copy". Paste your results in Excel.
These methods both fail to bring the Column Names over. However, if you have minimal number of columns, these methods work fine as you can easily recreate the headings.
You can also choose to have the results returned in text instead of grid in the Query Analyzer. I have run simple queries to text, and using the right click, "Select All" then copy and paste into Excel. You then need to use the "Text to Columns" feature in Excel to separate the data into Columns. This method returns the column names for you.
Probably the easiest, and method, if you have access to the Enterprise Manager as well, is to work in Query Analyzer, then copy your query into a "New View" run the query and get the results. Click the first column heading and drag your mouse to the last, highlightling all the columns, then hit CTRL+C (copy), paste your results into an Excel Worksheet and off you go.
I use these quite frequently for checking data in Excel.
One other way to do this is to use the MS Query tool in Excel. You can start a query using the Wizard, then click cancel. You will be prompted to continue "manually editing the query". Say Yes or OK to this. Then you get the MS Query Grid. Click the SQL Button and cut and paste your SQL statement in here from the SQL Query Analyzer and then click run. Return the data to Excel and "voila". This is great if you have a query that you use often that you want to export or "dump" the data, as you can save the spreadsheet, as a template even, so that it is available for quick updates.
Hope this helps.