O'Reilly logo
  • Dustin Waybright thinks this is interesting:

DECLARE
  @x AS VARCHAR(3) = NULL,
  @y AS VARCHAR(10) = '1234567890';

SELECT COALESCE(@x, @y) AS [COALESCE], ISNULL(@x, @y) AS [ISNULL];

Here’s the output of this code.

COALESCE   ISNULL
---------- ------
1234567890 123

From

Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012

Note

COALESCE is an abbreviated form of of CASE allowing for selection of the first value in a list of values that IS NOT NULL into a single column.