TheSQLGuru (2/27/2013)
You may THINK you want to do a Scalar UDF, but you probably don't. I wrote a chapter for the SQL Server MVP Deep Dives 2 book entitled "Death by UDF". It is a very aptly named missive. Please do everything in your power to avoid the UDF and inline the code where you need it.Oh, I haven't tested it, but I wonder if UDFs can call UDFs ...
Yes they can. if they're not iTVFs, it about as joyous as an aggregated view calling an aggregated view.
--Jeff Moden
Change is inevitable... Change for the better is not.