
Xiaohong L. answered 02/19/23
25 Years of Experience in Database Design / SQL / ETL / Reporting
No. If we execute the following 3 lines:
DECLARE @s VARCHAR(2) = NULL
SELECT COALESCE (@s, 'there')
SELECT ISNULL (@s, 'there')
We'll find COALESCE (@s, 'there') returns "there" and ISNULL (@s, 'there') returns "th". That's because in the case of ISNULL(), 'there' is first implicitly converted to the data type of @s, VARCHAR(2).