Old SQL Syntax ?

  • I've searched for this in the forum and can't seem to find anything.

    I'm reviewing a procedure that has been in place for years...

    What does the != represent in a portion of a Where clause below? Don't recall seeing != being used before.

    WHERE Name.FIRST_NAME != ''

    Thanks.

    Roger

  • That is not equal, != is equivalent to <>.

  • The ! means NOT, so != means not equals. Similarly you can have !> (not greater than) and !< (not less than).

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks all! Is the use of the ! applicable in any version of SQL? 2000? 2005? 2008? 2008 R2? Not sure if it is old syntax or something that is being phased out.

    Roger

  • All. No, it's not being phased out.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply