Home Forums SQL Server 2008 T-SQL (SS2K8) Alternate Way to Write query: ISNULL function causing issues RE: Alternate Way to Write query: ISNULL function causing issues

  • Eirikur Eiriksson (6/6/2016)


    Quick thought, the isnull statement is redundant ad null is never equal to null. It will on the other hand impede performance as the resulting execution plan will use scans rather than seeks.

    😎

    It's not in this case. If the pm.pdenddate is NULL and the pt.pdenddate is not NULL or '1900-01-01' (or vice versa) this expression will evaluate to TRUE whereas removing the ISNULLs it will evaluate to UNKNOWN.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA