Duplicate of: Should I use != or <> for not equal in TSQL
Within SQL Server's T-SQL should I use "<>" or "!=", or does it really even matter?
Duplicate of: Should I use != or <> for not equal in TSQL
Within SQL Server's T-SQL should I use "<>" or "!=", or does it really even matter?
Typical SQL usage in my experience is to use <>. I've never seen anyone use !=; I wasn't even aware that worked.
I believe that != is T-SQL specific (i.e. not standard SQL). So, you should use <> if there's any chance that you'll ever port your code to use a different DBMS.
Personally, I would use <> and forget about it.
I don't know SQLServer, but the SQL standard uses '<>', so follow the standard
If you only use SQL Server, it doesn't matter. They are synonyms.
Use <> since most people are familiar with that, and whenever NULLs are possible, remember that NULL is not equal to NULL, so this is sometimes necessary:
ISNULL(MY_FIELD,0) <> ISNULL(MY_FIELD,0)
!= isn't part of the standard, but it is part of T-SQL..
Duplicate Post..
http://stackoverflow.com/questions/723195/should-i-use-or-for-not-equal-in-tsql/723203#723203
I'd say it comes down to your coding conventions. I personally like to use != as <> reminds me of dirty dirty VB and gives me a bad gut feeling. Plus I comprehend it better as it is exact to C#'s not equal operator.