Coalesce vs Case
I prefer to use COALESCE
over CASE
. and the most interesting is the code is much shorter than using CASE
.
In some circumstances, ISNULL
is faster than CASE
or COALESCE
. However, if cross platform compatibility is an issue, COALESCE
is ANSI standard.
COALESCE()
is literally shorthand for a CASE
statement, they will perform identically.
However, as podiluska mentioned, ISNULL()
can be occasionally faster than a CASE
statement, but it's likely to be a miniscule increase as these functions are very unlikely to bottleneck your procedure.
Read here more about the performance differences.