SSMS Tips and Tricks 8-4: Using document groups

In a previous post, I showed how you might use split windows to allow you to work on different parts of a single query at the same time.
But what if you need to work on two queries and see parts of both of them?
That’s where document groups can help you. You can create both vertical and horizontal groups. For me, the most useful is typically side-by-side vertically, for when I’m comparing two sections of code.
From the Window menu, I choose New Vertical Document Group:
After I click that, as long as there are two or more queries open, I’ll see this:
I then have two queries that I can work with side-by-side. A horizontal document group places them one above the other.
In the image above, I had two queries in the left group, and one in the right group. You can also move queries between these groups. If I right-click the tab heading for one of the queries, I see this:
I can create yet another document group based on this tab, or move it to the next document group, or even close this document group by moving all tabs within it to the next document group.
2025-10-08