Alex Rivera | Logout

Does SQL Server support IS DISTINCT FROM clause?

Asked 2012-09-17T09:44:44.637
28

Does SQL Server support IS DISTINCT FROM statement which is SQL:1999 standard? E.g. the query

SELECT * FROM Bugs WHERE assigned_to IS NULL OR assigned_to <> 1;

can be rewritten using IS DISTINCT FROM

SELECT * FROM Bugs WHERE assigned_to IS DISTINCT FROM 1;
Edit
Report

1 Answer

26

IS [NOT] DISTINCT FROM is scheduled to be included in SQL Server 2022 (currently in public preview), see:


For earlier versions of SQL Server, the following SO question explains how to work around this issue with equivalent (but more verbose) SQL Server expressions:

answered 2012-09-17T09:47:45.037

Your Answer