• Hi Christian

    I agree that APPLY must be counted as part of the FROM clause, since it's the only place it can be used.

    So I think the correct answer should have been:

    It executes only once if the UDF is in the FROM clause and not in an APPLY sub-clause and executes at least once per output row if it is located in any other clause of the query.

    Obviously, it could execute many more times than the number of output rows, especially if a WHERE clause eliminates all the output. 🙂

    I suspect the author simply hadn't considered the APPLY sub-clause. Also the phrase "once per row" is very vague since it doesn't specify where the row is from.

    Derek.

    Derek