SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 not equal to
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gongxia649
So Suave

Azores
344 Posts

Posted - 04/26/2006 :  14:44:46  Show Profile  Visit gongxia649's Homepage  Reply with Quote
on sql server
!= and <> are the same?

cause i cant see != on books online.

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 04/26/2006 :  14:50:37  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

Azores
344 Posts

Posted - 04/26/2006 :  15:46:48  Show Profile  Visit gongxia649's Homepage  Reply with Quote
it works.
how come last time i tried with != didnt work.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 04/26/2006 :  15:50:28  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

Azores
344 Posts

Posted - 04/26/2006 :  22:13:51  Show Profile  Visit gongxia649's Homepage  Reply with Quote
i forgot
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 04/27/2006 :  00:07:14  Show Profile  Reply with Quote
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

India
22772 Posts

Posted - 04/27/2006 :  01:21:49  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
>>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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000