7

Possible Duplicate:
Testing for inequality in T-SQL

Hi,

does there any different to use the '!=' vs '<>' vs 'Not'?

which one will have the worst performance

or it exist just because of the backward compatibility syntax?

Community
  • 1
  • 1
mengchew0113
  • 399
  • 2
  • 4
  • 12

2 Answers2

10
  • NOT does not always act the same
  • != or <> are identical, no deprecation mentioned. <> is ISO though
onedaywhen
  • 53,058
  • 12
  • 94
  • 134
gbn
  • 408,740
  • 77
  • 567
  • 659
5

AFAIK, if you want to check for NULL, you must use IS NOT and not != or <>

abatishchev
  • 95,331
  • 80
  • 293
  • 426
alxx
  • 9,902
  • 4
  • 25
  • 40