What are you doing in the while loop? How many records are you looping through?
Very little should ever be done in a while loop. SQL server is much more efficient using set-based statments.
For instance if you are updating the recordset one record at a time (as you do in a loop) and there are 1,000,000 records, you are running 1,000,000 update statements. If you use a set-based update statment, then you run one statement.
Questions about posting. See faq183-874