FOR XML RAW turns each row of a query into an XML element. This post names the row element, adds a ROOT, switches to ELEMENTS and shows how a NULL value drops out of the output until XSINIL puts it back. Every result comes from SQL Server 2025.
ANY and ALL: Comparing a Value to a Whole Subquery in T-SQL
One missing price is enough to make ALL return nothing while ANY returns rows. Here is how to see it, and how to ask the question more safely.
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.
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.
LIKE Character Ranges: [a-f], [^0-9] and Collation Traps
A bracket range sounds simple until the collation decides what sits between a and f. Test it once so a bad code never reaches your table.
Unmatched Records Query: Four Ways to Find Rows With No Match
An unmatched records query finds the rows in one table that have no partner in another, such as plants that never sold. This post runs four versions on a small table: LEFT JOIN with a NULL test, NOT EXISTS, NOT IN and EXCEPT. It also shows the NULL trap that makes NOT IN return nothing.
SQL SERVER – Puzzle Involving NULL – Resolve – Error – Operand data type void type is invalid for sum operator
SELECT SUM over a lone NULL throws Msg 8117: Operand data type void type is invalid for sum operator. Here is why it happens and how ISNULL fixes it.






