The ISNULL(@t, 123) function ISNULL(@t, 123) returns 123 if @t is NULL, otherwise it returns @t. You can do something like this.
NULLIF(@t, -9223372036854775808)
This will return NULL if @t is -9223372036854775808. NULLIF returns the first expression (@t) if the two expressions are not equal.
source share