Jim Youmans-439383 - Thursday, March 23, 2017 6:13 AM
Oh yes... I absolutely agree and even said similar in my writeup. IF a UDF is actually the cause of a performance problem, it should be fixed.
And, to be clear, none of what I said was a slam on your code or article. I just had this vision that someone that may not know better may take your good code and make it an urgent mission to replace all Scalar UDFs in all their databases instead of correctly identifying possibly much more serious problems and fixing those first.
To be sure, thank you for taking the time to submit the code, explain why you wrote it, and participate in this discussion. Well done and thank you for making a difference.
--Jeff Moden
Change is inevitable... Change for the better is not.