find out how many records a query would return without executing it

  • No.

    The estimated execution plan can give you the estimated number of rows, but that could be exactly correct, slightly wrong or several miles out depending on a large number of factors

    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
  • Like Gail says, the only way to know exactly what a query will return is to run it. Even if the statistics were accurate 30 seconds ago, they may no longer be accurate because a row got inserted.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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