Skip to main content


Showing posts from June, 2009

The Case IsNull Now

In SQL Server views I've been using CASE statements to look for nulls for years. I've just nullified this practice.

For the following Employees Table:

Would be used to create the View:

This is the CASE:SELECT EmployeeID , LastName , CASE Nickname WHEN Null THEN FirstName ELSE Nickname END As Handle FROM Employees
ISNULLified by:SELECT EmployeeID , LastName , ISNULL(Nickname, FirstName) AS Handle FROM Employees