• Solomon Rutzky (5/6/2010)


    But then I tried the CROSS APPLY + $PARTITION approach and it took 1 minute and 30 seconds. Checking the stats it caused 1,262,939 logical reads and took 52,328 ms CPU Time and 89,744 ms elapsed time. I would have thought that the performance would have been, at the very least, equal to the WHILE loop.

    Yes it should be. Can't see your data or what you did, so hard to advise 😉