There are two parameters in SQL Server, syntax:
ISNULL (Check_expression, Replacement_value)
Check_expression and Replacement_value data types must be consistent
If Check_expression is NULL, the Replacement_value is returned
If Check_expression is not NULL, the check_expression is returned
Nullif is used to check two expressions, syntax:
Nullif (expression, expression)
If two expression equals, returns NULL, which is the data type of the first expression
Assuming that two expression is not equal, the first expression is returned
The descriptions of two functions in SQL Server that are inferred to be null are NULLIF and isnull such as the following:
Nullif: Requires two parameters, assuming two of the specified expressions are equivalent, returns null
Example: Nullif (A, B)
Description: Assuming that A and B are equal, then return null, assuming unequal returns a
Select Nullif (' eqeqweqwe ', ' 1 ') turns out to be eqeqweqwe
Select Nullif () result is null
The type of a and B should be consistent
ISNULL: Requires two parameters, the goal is to replace NULL with the specified value, and if the first parameter is not NULL, the first parameter is returned
Example: ISNULL (A, B)
Description: Assume that A and B are null at the same time, return NULL, assume that A is null,b not NULL, return B, assume that A is not NULL for NULL,B and return a, assuming that both A and B are not NULL to return a
Select ISNULL (null,null) result is null
Select ISNULL (null,33) results are 33
Select ISNULL (' DDD ', null) result is DDD
Select ISNULL (44,33) results are 44
IsNumeric: Verify that the expression is a valid numeric form
ISNULL and nullif in SQL Server