Press "Enter" to skip to content

Scalar UDFs Execute Once Per Row

Erik Darling proves that which we take for granted:

For the select list, T-SQL scalar UDFs will execute once per row projected by the query, e.g. the final resulting row count, under… Every circumstance I’ve ever seen.

In SQL server. Of course.

Read on for situations like having the function execute more than once per query, using functions for predicate evaluation, etc.