Re: How to sort NULLs?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Eric Sabine (mopar41_at_hyotyt_mail_nounderscores.com)
Date: 07/14/04


Date: Wed, 14 Jul 2004 10:07:56 -0400

IsNull is proprietary to SQL Server, COALESCE is part of the ANSI standard.
FWIW, I have never used IsNull in production code (or test code for that
matter). I am not aware of any performance difference. Incidentally,
COALESCE does more than IsNull anyway.

hth
Eric

Shabnam Naghshineh wrote:
> It worked. I posted a note before but I think it got lost.
> What is the difference between using ISNULL and COALESCE.
> I can write a (sql statement or query!!!! :) )like:
>
> Select location, product, value
> from mytabe
> order by insull(location,repreat('z',800)),
> insull(product,repreat('z',800))
>
> or use coalesce instead. Is there a performance difference?
>
> Thaks,
>
> Shab
>
>
> ** The contents in this message are provided as is and is not
> guaranteed to be correct **
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Update Trigger ( previous value )
    ... IsNull will work as well as Coalesce here. ... inner join,0), MaterialId from Inserted group by MaterialId) i on m.MaterialId = i.MaterialID ... Add a column that shows what the qty would be if we updated the qty by 1 for each row in MATERIAL_MISC. ...
    (microsoft.public.sqlserver.programming)
  • Re: left outer join in combination with a view
    ... ISNULL is kind of notoriously NOT the same thing as COALESCE and CASE, ... was skeptical that this was really a bug. ... create table test1 ...
    (microsoft.public.sqlserver.server)
  • Re: Bug?: left outer join in combination with a view
    ... >If you redefine the query to: ... COALESCE is ANSI-standard, ISNULL is proprietary. ... A guy named Markus recently ...
    (microsoft.public.sqlserver.server)
  • Re: Bug?: left outer join in combination with a view
    ... COALESCE has bug problems of it's own: ... would use ISNULL or COALESCE. ... A guy named Markus recently ...
    (microsoft.public.sqlserver.server)