A CTE is a name, not a saved result. Build both versions on 20,000 rows, compare the plans, and see why the answer is never always one or the other.
Materialized Path Hierarchies: Storing the Path as a String
Build a materialized path hierarchy in T-SQL, query descendants, calculate depth, and move a subtree without creating cycles.
SQL SERVER – Checking If a Column Exists in a Table
Let us see a script that will help check if a Column Exists in a Table. One of the common tasks that developers deal with when working on database-related projects
Unit of Measure Conversions: One Table for Kilograms, Pounds and Boxes
Adding kilograms, pounds and boxes gives a number that means nothing. Convert each product to one base unit and find the rows that cannot convert.
Recovering One Dropped Table From a Full Backup
Recover one dropped table through a separate restored database, choose the recovery point, copy its data, and rebuild the table rules.
max_column_id_used: How Many Columns a Table Once Had
The max_column_id_used column shows how many columns a table ever had. See it grow, find tables that lost columns, and avoid treating column_id as a position.
SQL SERVER – Legal CASE Defaults and Row Dependent Values
A CASE Expression can appear in a default, but cannot reference another row column there. My earlier blanket prohibition was incorrect.







