ISNULL in MySQL and SQL Server

ISNULL function behaves differently in MySQL and Microsoft SQL Server.

In MySQL, ISNULL tests whether the given expression is NULL. It returns 1 if the expression is NULL otherwise it returns 0.

However, in SQL Server, the null values are replaced with user-defined values during the expression evaluation process.

Look at the below examples:

MySQL:
SELECT ISNULL(NULL);
It returns: 1

SQL Server:
SELECT ISNULL(NULL,’SomethingElse’);
It returns: SomethingElse

Leave a Reply