Unfortunately not.
A word of warning, for extremely intensive usage, I've found that scalar functions (even those which could be easily inlined with a CASE
, like yours) really do not perform well on SQL Server 2005, so if you are dealing with millions of calls, put it inline (sometimes you can fake an inline TVF).
Hopefully, SQL Server will eventually have an inline SVF or have a function equivalent to GREATEST
!