Explain order without ORDER BY through parallel scans, NOLOCK allocation scans, alternate indexes, shared scans, and the explicit sort fix.
Shortest Distance Between Two Shapes in SQL Server: Ramsetu or Adam’s Bridge
The shortest distance between two shapes in SQL Server comes from ShortestLineTo and STDistance. The tests here show the numbers behind the three original pictures, what happens when shapes overlap or use different SRIDs, and the same method on the globe near Ramsetu.
MultiSubnetFailover: Why Clients Time Out After an AG Failover
Diagnose an AG failover timeout with listener DNS, MultiSubnetFailover, RegisterAllProvidersIP, HostRecordTTL, and client-driver checks.
Replacing a Running Total Cursor With a Window Function
That loop adding to a variable can usually become one window function. Here is the proof that the balances match, and the tie trap to watch for.
Reading a Backup File Before You Restore With RESTORE HEADERONLY
Use RESTORE HEADERONLY to identify backup sets, source versions and finish dates before selecting a restore and checking the media.
SQL Server Indexing Basics: SQL in Sixty Seconds #006
SQL Server indexing basics start with the query you want to help. The tests here use a 200,000 row table to compare a scan, a plain index and a covering index, show when SQL Server ignores an index, and measure what three extra indexes cost on an insert.
Intra-Query Parallel Deadlock: When One Query Blocks Itself
No error, no deadlock graph, just a report that is slow on some runs. Here is a demo where one query deadlocks with itself, and how to fix it.







