abhi620 (5/20/2011)
i think this is good solution for...
With only very few exceptions, the RBAR of a WHILE loop is almost never a good solution. Please try it on a couple of hundred thousand rows and see.
--Jeff Moden
Change is inevitable... Change for the better is not.