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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 A basic SQL question regarding operands

Author  Topic 

owen912
Starting Member

31 Posts

Posted - 2004-10-25 : 11:22:44
Here are two WHERE clauses:

WHERE(ColumnA <> ColumnB)

WHERE(ColumnA != ColumnB)

Is there a difference?
Is one better than another?
Is one regarded as a "best practice"?

When writing web applications, I write in C# and my style preference is "!=", but I wonder if there is a practical difference, or is it a matter of style.

Thanks,

Mike

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-10-25 : 11:37:48
a matter of style.
!= is not SQL-92 standard

i'm a C#-er but i use <>...

Go with the flow & have fun! Else fight the flow
Go to Top of Page

owen912
Starting Member

31 Posts

Posted - 2004-10-25 : 12:10:45
Thanks. I've always used <> in my SQL and didn't know I could use != until I saw it in a lagacy databaseI am working with.

The fact that it's not SQL-92 standard make sense. This database was originally developed a long time ago.
Go to Top of Page
   

- Advertisement -