SQL Server Performance

ISNull and IS Null

Discussion in 'SQL Server 2008 General DBA Questions' started by RVG, Jan 14, 2010.

  1. RVG Member

    What is the difference between isnull and is null?
  2. moh_hassan20 New Member

    isnull is a function Replaces NULL with the specified value.
    declare @qty int
    set @qty = null
    select ISNULL (@qty,0) -- replace qty with 0
    result : 0

    IS NULL : is operator to check whether a specified expression is NULL in sql statements

    SELECT id, Name
    FROM emp
    WHERE name IS NULL

  3. RVG Member

    Thanks Mr.Hassan..

Share This Page