What is the '!' for?

  • I should probably know this but what is the '!' for?

    SELECT * FROM sys.dm_exec_sessions WHERE Status != 'sleeping'

  • ! = NOT

    So that's a query for status not equal to sleeping

    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
  • "!=" is another way of forming a "not equal" operator, like "<>".

    "!=" is not ISO standard, so it is better to use "<>".

  • ahh...thanks Gail

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

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