SELECT SUM over a lone NULL throws Msg 8117: Operand data type void type is invalid for sum operator. Here is why it happens and how ISNULL fixes it.
SQL SERVER – Explanation and Understanding NOT NULL Constraint
What a NOT NULL constraint does and two ways to add one: when the table is created, or after the table is created. My example covers both.
SQL SERVER – Explanation and Comparison of NULLIF and ISNULL
NULLIF returns NULL when two expressions are equal and the first one when they are not. Here is how it compares with ISNULL and the matching CASE expression.
SQL SERVER – LEN and DATALENGTH of NULL Simple Example
A common mistake is checking LEN(@var) = 0 for a NULL value. LEN and DATALENGTH of NULL both return NULL, not zero, as this simple example shows.



