bobie (2/7/2013)
What I mean is not a combination temp table and while loop but temp table with an bulk update statement with help of variable, is it the same as while loop?Because if I check the statistics io and the time needed to execute it is much2 lower io and faster.
Ah! Understood. Yes. Doing a "Divid'n'conquer" using a Temp Table to hold interim results during "bulk updates" is much better than using cursors or while loops. Of course, you can't use Temp Tables in functions and Table Variables usually aren't the thing to use when a lot of rows are present.
--Jeff Moden
Change is inevitable... Change for the better is not.