mburbea (5/8/2014)
That's what I figured. I hate scalar udfs in sql server as they tend to perform so poorly 🙁
Me too. I rarely (very rarely!) use them or recommend them, but in this case it seems guaranteed to only ever operate on a single data item, so it should be ok. Depends whether you think the neatness is worth forcing yourself to use a scalar function, I suppose!
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi