ISNULL and COALESCE though equivalent, can behave differently. An expression involving ISNULL with non-null parameters is considered to be NOT NULL, while expressions involving COALESCE with non-null parameters is considered to be NULL.
http://msdn.microsoft.com/en-us/library/ms190349.aspx
It determines the nullability of, say, a computed column using ISNULL or COALESCE
RowCheckSum AS COALESCE(...)
...means that RowCheckSum
column definition has NULL
keyword, and
RowCheckSum2 AS ISNULL(...)
...has NOT NULL
definition.
This also means, that in result set first field can return NULL
values, and second - cannot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With