Aggregates on Empty Sets in T-SQL
Applies to SQL Server 2019, 2022 and 2025. Aggregates on empty sets behave in a way that surprises people the first time they hit it in a report. Ask SQL Server to total an empty table and you don’t get zero rows back, and you don’t get zero either: you get one row containing NULL….