Export (0) Print
Expand All
Expand Minimize

= (Equals) (Transact-SQL)

Compares the equality of two expressions (a comparison operator).

Topic link icon Transact-SQL Syntax Conventions


expression = expression

expression

Is any valid expression. If the expressions are not of the same data type, the data type for one expression must be implicitly convertible to the data type of the other. The conversion is based on the rules of data type precedence.

When you compare two NULL expressions, the result depends on the ANSI_NULLS setting:

  • If ANSI_NULLS is set to ON, the result is NULL, following the ANSI convention that a NULL (or unknown) value is not equal to another NULL or unknown value.
  • If ANSI_NULLS is set to OFF, the result of NULL compared to NULL is TRUE.

Comparing NULL to a non-NULL value always results in FALSE.

Boolean

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft