Scalar UDFs - Expanded T-SQL constructs and query shapes for computation-based UDFs
Data Warehouse · Public preview · Planned
Description
Computation-based scalar UDFs now support WHILE loops, multiple RETURN statements and deeply nested IF-THEN-ELSE blocks in the function body. They can also be used in queries that include Common Table Expressions (CTEs), and within GROUP BY, HAVING, and ORDER BY clauses.
Change History
-
2026-05-13
Feature Description We're expanding the capabilities of scalar user-defined functions. This update unlocks new scenarios for **computation**-based UDFsincluding support for while loopsmultiple return statementsand complex control flows. Computation-based scalar UDFs can now be used in additional query shapesincluding Common Table Expressions (CTEs) and within GROUP BYHAVINGand ORDER BY clauses. -> Computation-based scalar UDFs now support WHILE loopsmultiple RETURN statements and deeply nested IF-THEN-ELSE blocks in the function body. They can also be used in queries that include Common Table Expressions (CTEs)and within GROUP BYHAVINGand ORDER BY clauses.Name Scalar User-defined functions (UDFs) - Complex control flows in computation-based UDFs -> Scalar UDFs - Expanded T-SQL constructs and query shapes for computation-based UDFs -
2026-04-23
Roadmap Item Added
Workload: Data Warehouse