Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performance of While LOOP vs CURSOR

Status
Not open for further replies.
Mar 29, 2004
120
US
Hi,

I can implement either a While LOOP or a Fast_forward Cursor, which one would generally perform better for a set of say 10,000 thousand records?

Thanks
 
Neither. It is best to perform operations in sets vice loops if at all possible. I have read that while loops are minimally more efficient than cursors, but neither is anything to write home about. Replaing a cursor with a set-based solution can often saves hours of processing time.

Questions about posting. See faq183-874
Click here to learn Ways to help with Tsunami Relief
 
by set-based I think you mean a table-driven solution, either temp table or a query, such as:

select A, B
from (select C from table C....)

I will see if I can do this instead, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top