Mark-101232 (9/24/2012)
NULL can also be handled by adding 'RETURNS NULL ON NULL INPUT' to the wrapper.
Yes that is true.
I did wonder about asking what should be returned for NULL input.
Some might prefer a zero return value - I didn't want to assume.
Adding the RETURNS thing does prevent the function being called which is nice.
That reminds me of a very welcome addition to SQL Server 2012: deterministic SQLCLR scalar functions can be constant-folded!
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi