jhager (7/5/2013)
Thanks all for replying; although I was aware of the "precedence" feature of COALESCE, I didn't realize that literal values would be typed differently, in this case 99 as an INT. Thanks for the code to determine type, I'll have to check many other code objects as we use COALESCE quite frequently in our work.~ Jeff
If you are using COALESCE() where you might use ISNULL() - as in your first post - then you might benefit from reading this Adam Machanic article.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden