Why does the following expression in SQL Server return -9223372036854775808 and not 123?
I am calling this from a stored proc where I can’t pass null parameters
declare @t bigint;
set @t = -9223372036854775808; --min value for bigint / long
select ISNULL(@t, 123)
Because:
Being negative doesn’t mean the value is NULL. NULL is the lack of any value at all.