Why the script below returns NULL
instead of 0
?
DECLARE @number BIGINT = 0;
SELECT NULLIF(@number, '');
According to the MSDN, it should return 0
:
NULLIF
Returns a null value if the two specified expressions are equal.
For SQL server, 0
and ''
is considered the same (=equal)? What is the logic behind?