Michael Valentine Jones (1/8/2012)
The overhead of the function call can have a large impact on the results.
Understood and agreed... that's precisely the reason I posted such a test... to show just how bad using a MS provided scalar function can be when compared to simple in-line code. Speaking of which, if you'd like to convert your code to an in-line Table Valued Function, I'd be happy to include that in the testing. Unless I'm terribly mistaken, you won't see much of a difference using such an iTVF.
--Jeff Moden
Change is inevitable... Change for the better is not.