>>I think you would need to select them into the cursor then. See DECLARE CURSOR topic in BOL.
>
>Thanks, this has helped me fine tuned the code.
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.
If it's not broken, fix it until it is.
My Blog