In SQL Server, if you’re getting error Msg 4127 that reads “At least one of the arguments to COALESCE must be an expression that is not the NULL constant”, it’s probably because all of your arguments to the COALESCE()
expression are the NULL
constant.
To fix this issue, make sure at least one argument is not the NULL
constant.