The distance between two points on the earth takes one method call once you store the points as a geography value. This post builds a small table of five US cities, turns latitude and longitude into points, and measures with STDistance in meters, kilometers and miles. It also compares the answer with a flat map formula and a sphere formula, and shows the error for swapped arguments.
Space Used by Sparse Data: How SPARSE Columns Save Bytes
Space used by sparse data depends on how many values are NULL. This post loads 100,000 coupons into a normal table and a SPARSE table, measures the row size and the pages, and finds the point where SPARSE stops paying off. It also shows that a NULL in a sparse column costs nothing, and that a value costs more than usual.
GETUTCDATE and SYSUTCDATETIME: Which Current Time Function Returns What
GETUTCDATE and SYSUTCDATETIME return the current time in UTC, while GETDATE and SYSDATETIME return the local time of the server. This post runs all four side by side and shows their data types and precision. It also shows why GETDATE values always end in 0, 3 or 7, and why a time stamp column should store UTC.
AI_GENERATE_CHUNKS in SQL Server 2025: Splitting Long Text Into Pieces
AI_GENERATE_CHUNKS cuts one long piece of text into smaller pieces inside a query. This post tests the preview function on SQL Server 2025, shows what its columns hold and how overlap works, and explains how chunk size changes the number of pieces.
Data Row Space Usage: Estimate Row Size Before the Table Grows
Data row space usage is the number of bytes one row takes, and every table size estimate starts there. This post adds up the five parts of a row for a small table of rooms and checks the result against what SQL Server reports. It also shows that NULL does not shrink a fixed-length column, and turns 100,000 rows a day into pages and megabytes.
Output Clause in Simple Examples: See the Rows You Just Changed
The OUTPUT clause shows the exact rows an INSERT, UPDATE or DELETE just changed, using the inserted and deleted tables. This post covers the output clause in simple examples with a small table of seed packets. It also shows how to save the rows with INTO, what error you get for the wrong table, and why triggers change the rules.
NTILE Groups: How Uneven Rows and Ties Land in Each Tile
NTILE groups your sorted rows into the tiles you ask for, but the groups aren’t always the same size. This post uses ten hiking trails to show the sizes when rows do not divide evenly, how tied rows land in different tiles, and what happens with more tiles than rows. It also shows how to pull the top 2 percent of a list.







