Andy Brownsword checks some data types:
Last week we looked at how expressions are evaluated with the
ISNULLandCOALESCEfunctions. Whilst we’re in the area it’s worth running through how data types are selected for them too. It might have implications with how you implement them.The way these functions choose which data type to return differs, so they aren’t direct swap outs for each other, and you can’t simply ‘upgrade’ an
ISNULLtoCOALESCEand expect the same result.
Read on to see how the two behave under different circumstances with changing data types.