SSMS Tips and Tricks

Working with multiple queries

Views 326

Working in SQL Server Management Studio is potentially an everyday occurrence for you! And having to work with many queries open at the same time is probably the norm.  Depending on the size of your screen that you may be working on, you are limited with the amount of screen real estate you can work in.

Personally, I get frustrated with having to continually go to the open query drop down window to see what queries I have open and be able to cycle through them to make my life easier and be more productive.

For the purpose of this short blog post, I have SSMS 19 open and connected to a local SQL Server 2022 instance of sql server. I opened 5 new query windows, and yes they have no query code, but the point is to show the limitation that I can only see 4 of those 5 queries available to me at any one time in the tab header.  So this means I have to go to the open query drop down and I can see the full list of all 5 queries. In your day to day activities, this might be 10 or 20. It does not matter.

To assist us, we do have the ability to pin a query, ensuring that it never goes offscreen. But if you have more queries open than fitting on the screen like we can see above this still does not fix the problem and I still have to go to the query drop down window to access other queries. And this is where this tiny little tool tip can help you out and become more productive.

In the menu, navigate to Tools | Options and we can with a few short clicks make our life easier.

Select Tabs and Windows and click “Show pinned tabs in a separate row”

With those 4 simple clicks, and 1 for save, we are not able to be more productive and make better use of our screen real estate. You can see now that Query 5, as it was the only pinned query is now on its own row and we can see all 5 queries.

What will also make things easier is if you save these queries so that they are name appropriately, therefore making it easier for you to navigate to the correct script.

I hope this tip makes things easier for you.

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Warwick

I am a Microsoft Data Platform MVP as well as a Microsoft Certified Master working as the Principal Consultant here at SQL Masters Consulting. When I am not working with the SQL Server Stack I like to get away to the Snow and spend time Snowboarding.

Search