Home Forums SQL Server 2008 SQL Server 2008 - General “SELECT 1″ rather than a “SELECT *” when using an EXISTS or a NOT EXISTS clause”. RE: “SELECT 1? rather than a “SELECT *” when using an EXISTS or a NOT EXISTS clause”.

  • No difference. No matter what you use, it's removed early in the parsing stage. I use SELECT 1 to make it extremely clear that the exists is not returning any columns.

    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