SQL Kiwi (9/24/2012)
Handling NULL and -2147483648 is another good point (though the original test rig can produce neither value, in my defence).
NULL can also be handled by adding 'RETURNS NULL ON NULL INPUT' to the wrapper.
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537