SQL Server: Difference between <> and != operator

Two Different Not equal to operators - Difference
Once I was using <> operator in a query.
select * from Mytable where col1 is not null and col1 <> ''
Where as one of my colleagues used != operator.
select * from Mytable where col1 is not null and col1 != ''
Both the queries resulted the same. I just googled to know the answer and I got this

http://msdn.microsoft.com/en-us/library/ms188074.aspx

There is no difference between both the operators technically or performance wise.
!= operator is not an ANSI standard. So better to use <> operator.

No comments:

Post a Comment