Stacked

functional

Keep every result in view on one scroll when the whole batch matters.

Stacked keeps every result in one scroll as a resizable, collapsible card. It is the layout for when several sets need to stay in view together: collapse the finished ones and keep moving.

When it is the right choice

  • A script you are working through. Each step leaves its answer on screen, so you can see what step two returned while reading step five.
  • Narrow results. Several small sets - counts, a status row, a short list, waste a whole pane each in Tabbed and read beautifully stacked.
  • Comparing by eye. Two sets one above the other, both visible, with no clicking between them.

Working the stack

In Stacked, the results tab bar shows a single Results tab that holds every card, next to Messages and the other output panes. Each card has a header, its grid, and a footer that shows statistics for the cells you select in it.

  • Collapse a card by clicking its name in the header; click again to open it. The header keeps showing the row count, as in (42 rows), so a collapsed card is still informative.
  • Resize a card by dragging the divider beneath it, every card has one, the last included. Cards start at a height that suits their row count, so a three-row set does not claim half the screen.
  • Allot rows from the SQL. -- sqlly lines: 8 on a line of its own gives every card eight rows; -- sqlly lines 3: 25 gives the third result set twenty-five. A dragged divider still wins for that run. -- sqlly layout: stacked opens the run in this layout to begin with.
  • Rename a card with the pencil beside its name. The name is saved as a -- sqlly name comment in your SQL, so it comes back on the next run.
  • One set fills the pane. When a run returns a single result set, its card takes the whole area rather than a fixed height.

On the right of the tab bar, Stacked adds four buttons: Clear grouping, Filter rows…, Clear filters, and Clear sort. The clear buttons act on every card at once, which is the quick way back to the raw results after sorting and filtering your way through a few sets.

An example

A before-and-after check around a data fix, where every step is worth keeping on screen:

-- sqlly layout: stacked
-- sqlly lines: 6
-- sqlly lines 2: 20
-- sqlly name 1: Status counts
-- sqlly name 2: Stuck orders
-- sqlly name 3: Oldest stuck
SELECT status, COUNT(*) AS orders
FROM dbo.Orders
GROUP BY status;

SELECT order_id, customer_id, updated_at
FROM dbo.Orders
WHERE status = 'pending'
  AND updated_at < DATEADD(day, -7, GETDATE());

SELECT MIN(updated_at) AS oldest
FROM dbo.Orders
WHERE status = 'pending';

Stacked shows three cards. The counts and the single oldest value take a few lines each, the stuck-order list gets the room, and once you have read the counts you can collapse that card and drag the list taller.

Things to know

  • Every grid is built. Stacked lays out a grid for every set so they can all be on screen, where Tabbed builds each one only when you open it. For a batch of several very large sets, Tabbed is the lighter choice.
  • Each card is a full grid - with its own Grid, Pivot, and Chart tabs - a pivot can sit in one card above the raw rows in the next.

Reach it from Result layout on the results tab bar, the layout toggle in the query toolbar, or Tools › Layout › Stacked Layout on any grid's right-click menu; the choice is remembered per editor tab when session resume is on.

SQLly
SQLly stacked result layoutSQLly stacked result layout
Multiple result sets as stacked, collapsible cards in one scrolling column.