Ok I admit - I use it. Pretty much everyone I know uses it and yet I feel dirty when I do.
Why? Well it's not portable SQL and most certainly not ANSI standard. I need to get the datetime I hear you say. How do I do this without getdate()?
There is a perfectly good substitute in the form of CURRENT_TIMESTAMP that is ANSI standard and therefore portable. It's in SQL Server and works exactly the same as getdate(). So why don't we all use it?
Based on my personal experience, my guess is that it is longer to write and more cumbersome to say. However, I don't feel I can excuse myself when, as a result of my actions, the SQL I have written has been tightly bound to SQL Server and it needn't have been the case.
I find I am much more militant about the use of ISNULL() rather than COALESCE(). It's the same deal. COALESCE() is portable and functionally the same as ISNULL(). So why do so many people use ISNULL()? I have no idea. I always use COALESCE() but then I also prefer the word :o).
I don't seriously expect the SQL Server product team to drop these functions; mainly because of the body of legacy code out there. I'd love it if they did - once I had fixed all of my code...
However, I do think we should all make more effort to keep our code portable. What do you think?
Cheers, James