Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2004
    Posts
    75

    Question Unanswered: Easy Question on inequality



    In T-SQL I could use <> or != to do an inequality comparison.

    However which method would be most suited?

    I and my co-workers use C# so I think I'll use !=.

    This fits in with our dev language pilosophy.

    Are there any reasons why I shouldn't?

    Opinions welcome.

    Shaun McGuile
    "...you think the worms of Dune are big, wait till you see the sparrows!"

  2. #2
    Join Date
    Mar 2007
    Location
    Holmestrand, Norway
    Posts
    332
    Afaik there is absolutely no difference. As you, i strongly preffer using !=
    Ole Kristian Velstadbråten Bangås - Virinco - MSSQL.no - Facebook - Twitter

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Old style syntax such as "!=" is supported by MSSQL, but not encouraged.
    The familiar "<>" is more universally recognized.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jun 2004
    Posts
    75

    Cool Hmm 'Old Style' I don't know about that

    I find it strange that its old style

    I would have said that <> is BASIC programming style

    and

    != is more C# and Javascript style.

    (from my perspective more modern).

    Regards

    (3 Card Brag - Rules - you can't see a blindman!).

  5. #5
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I think what the BM is saying is that one is MS specific and the other is in the ANSI-92 specification. If you ever need to port your app to another DB platform the less MS specific code you have the better off you will be.

    who cares what is more in line with app code?

    BTW, you spell sean the wrong way.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    He is using the old Ansii-standard "Shaun", while you are using the MS-specific "Sean".
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Jun 2004
    Posts
    75

    Spelling

    Quote Originally Posted by Thrasymachus

    BTW, you spell sean the wrong way.
    Hmm try telling that to my Welsh co-worker Sion.

  8. #8
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Or my sister-in-law, Cion
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •