2

Possible Duplicate:
Should I use != or <> for not equal in TSQL?

Behavior of both operator is same. But i want to know about What is difference between operater != and <> in SQL Server?

4
  • One is ANSI one isn't. Duplicate... Commented Jun 22, 2012 at 11:08
  • @MartinSmith: I thinks the question differs in that the OP asks on what is the fundamental difference between the operators rather than which one to use. Commented Jun 22, 2012 at 11:11
  • @mankand007 - There is no fundamental difference. They are functionally identical. This question is basically a sub question of the other. if there were any fundamental difference it would be addressed there. Commented Jun 22, 2012 at 11:13
  • It's quite easy to find the difference in the docs ... msdn.microsoft.com/en-us/library/ms190296.aspx Took 10secs to find. I don't see the point of asking it here. Commented Jun 22, 2012 at 11:42

3 Answers 3

3

Technically both != and <> are same. Even if you use them in stored procedures also they will behave same in terms of performance. As a SQL standard you should prefer <>.

NOTE: != operator is not standard SQL.

Sign up to request clarification or add additional context in comments.

Comments

2

They are equivalent. The only difference is that the <> is ISO standard, the != is not.

Check out this link: http://msdn.microsoft.com/en-us/library/ms188074.aspx

Comments

0

a <> b basically checks that a is either less than or greater than b; i.e, not equal to b. I believe both a and b are converted to their ascii values and then compared.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.