Thursday, April 12, 2007

Show/Hide Results Pane -- SQL Server 2005

Attention! Unfortunately Blogger lost all the screenshots for this post, but I created a new post for SQL Server 2008 that is virtually identical.  You can get there by following this link: Show/Hide Results Pane – SQL Server 2008

I've been using Microsoft SQL Server 2005 for a few months now, and I've noticed a few differences between the SQL Server 2000 Enterprise Manager / Query Analyzer tools and the new Management Studio. I'll post some quick things I did to feel more at home in the new development environment.

Show/Hide Results Pane

One of the simplest and most useful features when debugging a script is to able to run your query to see some results, then hide the results pane to continue tweaking the sql code. This feature was a button in Query Analyzer in SQL Server 2000, but for some reason disappeared from the default buttons available in SQL Server 2005's Management Studio. Well, the button may not exist as a default button, but it's easy to add it back in.


After running a script in a query window, the window splits between the script and the results (each referred to as a pane). See the snapshot above.

To add a button to hide the results pane, click on the little down-arrow at the end of a toolbar and choose "Add or Remove Buttons", then choose "Customize..."

The Customize dialog window will open with the "Commands" tab selected. Now we only need to find the command we are looking for. Under "Categories:", choose "Window". Then under "Commands:", find the command "Show Results Pane".




Once you have located the "Show Results Pane" command, you have to click and drag it to where you want it to be located on the toolbar.
You can now Hide the Results Pane

Or you can Show the Results Pane

Originally I had my button located on the Standard toolbar, but eventually I figured out it made more sense to add it to the SQL Editor toolbar. It's pretty easy to find the SQL Editor toolbar - it only displays when you are working in a query window.