ISNULL and NULLIF SQL SERVER

Published: 06 February 2022
on channel: Vikash DBA (RDMS tutorial)-SQL GUIDE
985
9

Difference between ISNULL and NULLIF SQL SERVER?
please watch complete so you can understand the difference

ISNULL (Transact-SQL)
ISNULL ( check_expression , replacement_value )
--first argument is NULL so function return the second argument
SELECT
ISNULL(NULL,1)

--character string example
--first argument is not null so it returned first argument only
SELECT
ISNULL('DBA', 'SQL')


NULLIF
--For example,
returns NULL for the first column (3 and 3)
because the two input values are the same

SELECT NULLIF(3,3)
go
select NULLIF(6,7) -- returns the first value (6)
--because the two input values are different.

SELECT NULLIF('DBA', 'DBA')
SELECT NULLIF('SQL', 'DBA')


On this page of the site you can watch the video online ISNULL and NULLIF SQL SERVER with a duration of hours minute second in good quality, which was uploaded by the user Vikash DBA (RDMS tutorial)-SQL GUIDE 06 February 2022, share the link with friends and acquaintances, this video has already been watched 985 times on youtube and it was liked by 9 viewers. Enjoy your viewing!