MS SQL Server / SELECT clause with a CASE expression

In SQL Server, if you have a column which has NULLs and instead of nulls, if you want to display ‘Nothing’, what would you do?

The following query

SELECT CASE Dept_Name WHEN NULL THEN 'Nothing' ELSE Dept_Name END Dept_Name
FROM Inventory

would still display the nulls and not ‘Nothing’.

Workaround:

Continue reading “MS SQL Server / SELECT clause with a CASE expression”