>You're welcome. Are you sure you need to loop and can not do this in one shot as Sergey showed? Using cursors in SQL Server is slow. Of course, if this is one time deal or small set of records, it doesn't matter.
I need to have it in a loop as I will add more processes soon.