Oracle NVL equivalent on MS SQL

I have been an Oracle DB person for quite a while until my new job where we are running DB2 and MS SQL for the moment. Now, in Oracle, the NVL() function is a quick shortcut for series of nasty CASE THEN ELSE statements. Since the data am dealing with here is a little messy, I needed plenty of such.To make matters worse, SQL is the only common denominator for me between Oracle and MS SQL (as far as Mr. Olowe is concerned).

Anyway, after banging my head on the table exactly 1001 times, I finally discovered that ISNULL(element_to_check,value_if_null) does the same thing. I gleefully went over my previous codes and yanked the sonafab***h CASE statements out.

Knowledge is really power.

To read more on ISNULL for MS SQL, head over to http://msdn.microsoft.com/en-us/library/ms184325.aspx


Discover more from Adedeji Olowe

Subscribe to get the latest posts sent to your email.

Author: Adedeji Olowe

Adedeji / a bunch of bananas ate a monkey /

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Adedeji Olowe

Subscribe now to keep reading and get access to the full archive.

Continue reading