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.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
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.
SQL Server slow? Let's fix it together in about four hours.
In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.
You keep every script, and the know-how to fix it yourself next time.
Want your whole team to learn it?
My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.
Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.
Who We Are
Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.
Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.
Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).
Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.
Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

