• AndrewSQLDBA (1/11/2013)


    I would like to get suggestions or advice on how I can re-write this to be so much better performing. Not having to seek the entire table all those times.

    That will execute as a single table scan. None of those are SARGable, so no seeks possible.

    What's this supposed to do?

    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