• No worries. You're doing fine with the use of Scalar UDFs. The way you are using them is actually the only way I support their use. I just do not see them implemented that way all that often so I assumed the worst, sorry about that. I usually see them being abused in SELECT-column-lists, JOIN predicates and WHERE-clauses wrapping columns. You're team seems to have stayed away from that mess but has really taken the ball and run away with it, albeit in a different direction. I strongly suspect you could best that 6m mark if you went set-based, but I hear what you're saying about maintainability.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato