babelfish_extensions
babelfish_extensions copied to clipboard
COALESCE() T-SQL function does not work with different data types
The COALESCE() T-SQL function throws invalid input syntax error when its arguments are of not the same data type:
1> SELECT COALESCE(NULL, 1, 2, 'I am a string')
2> go
Msg 22, Level 16, State 1, Server BABEL, Line 1
invalid input syntax for integer: "I am a string"
In SQL Server,:
1> SELECT COALESCE(NULL, 1, 2, 'I am a string')
2> go
-----------
1
(1 rows affected)