ISNULL takes only two parameters. The function returns the value of the first of its input parameters that is not. The parameters passed to Coalesce do not have to be string data types, they can be any data type and can also be different data types. I want them in the order they are in the coalesce expression. Thanks for the suggestion though.
The hard-coded null was just something I threw in for testing that exposed this behavior.
Returns the data type of expression with the highest data type precedence. If all expressions are nonnullable, the result is typed as nonnullable. And obviously, your varchar value cannot be so converted. SQL Coalesce with empty string.
It will check for NOT NULL values sequentially in the list and it will return the first NOT NULL value. COALESCE must be of type int. If NULL needs special handling, different from any other value, your only option is to use an IF.
The arguments are evaluated in the order in which they are specifie and the result of the function is the first argument that is not null.
The result is null only if all arguments are null.
