Search This Blog

Thursday, November 1, 2012

SET ANSI_NULLS SQL Server

Specifies ISO compliant behavior of the Equals (=) and Not Equal To (<>) comparison operators when they are used with null values.

SET ANSI_NULLS { ON | OFF }

When SET ANSI_NULLS is ON, a SELECT statement that uses WHERE column_name = NULL returns zero rows even if there are null values in column_name.

When SET ANSI_NULLS is OFF, the Equals (=) comparison operators do not follow the ISO standard. A SELECT statement that uses WHERE column_name = NULL returns the rows that have null values in column_name.