Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 not equal to

Author  Topic 

gongxia649
So Suave

344 Posts

Posted - 2006-04-26 : 14:44:46
on sql server
!= and <> are the same?

cause i cant see != on books online.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-26 : 14:50:37
Why not try it?


DECLARE @i int, @j int

SELECT @i = 1, @j = 2

IF @i <> @j
PRINT 'Does not equal'
ELSE
PRINT 'Equals'

IF @i != @j
PRINT 'Does not equal'
ELSE
PRINT 'Equals'


Tara Kizer
aka tduggan
Go to Top of Page

gongxia649
So Suave

344 Posts

Posted - 2006-04-26 : 15:46:48
it works.
how come last time i tried with != didnt work.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-26 : 15:50:28
I only use <>.

Please post the code that didn't work for you.

Tara Kizer
aka tduggan
Go to Top of Page

gongxia649
So Suave

344 Posts

Posted - 2006-04-26 : 22:13:51
i forgot
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-27 : 00:07:14
From BOL
quote:
!= (Not Equal To)

Tests whether one expression is not equal to another expression (a comparison operator). Functions the same as the Not Equal To (<>) comparison operator.




KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-27 : 01:21:49
>>cause i cant see != on books online.

It is available in Books On Line under the topic Comparison Operators

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -