• venoym (1/28/2015)


    An index on the ID (even unclustered) would solve the speed up the ordering problem with the TOP (1), but you could also would have add an "ORDER BY sdlh1.ID DESC" to it to make ensure it always works properly...

    Fixed that for you 😉 😀

    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