• Actually...it is significantly different, per my optimizer it costs 2.5% of the total cost of both (although this includes creating the table variable, which I would HOPE you had in for testing purposes only).

    I would agree that this is not significant if it's under a 100 loops or so (which is the case in your example), but it is significant with more loops.  I might add, under a 100 loops there is no significant difference between a cursor and either while loop.

    I certainly wasn't saying you should modify your existing code.  But since your article was about optimization, I figured you'd be interested.  Seems like you are a little defensive instead.  Oh well...

    cl

     

    Signature is NULL