To SELECT a single row for a quick look at a table, set up an SSMS query shortcut that runs SELECT TOP 1. The tests here show which row comes back, how an index or a heap changes it, what it costs on a 200,000 row table and when to add ORDER BY.
Row Goals: Why TOP and EXISTS Change the Plan
Inspect row goals from TOP and EXISTS, read EstimateRowsWithoutRowGoal, and compare a targeted optimizer hint using actual plans.
Breaking Ties Deterministically: Why ORDER BY Needs a Tie-Breaker
Tied scores can come back in any order, which breaks paging. Here is the one column that fixes it.
Top and Bottom Rows With a CTE in SQL Server: Part 2
Top and bottom rows with a CTE come from two ordered queries, one for each end of the table. This follow-up tests the reader’s single-CTE version and a two-CTE version on SQL Server 2025. It also compares a ROW_NUMBER version that read 336 pages against 4 for TOP, and shows what ties, empty tables and one-row tables return.




