sql server - Cursor verus while loop - what are the advantages/disadvantages of cursors? -
is idea use while loop instead of cursor? advantages/disadvantages of cursors?
some of these depends on dbms, generally:
pros:
outperform loops when comes row-by-row processing
works reasonably large datasets
cons:
don't scale well
use more server resources
increases load on tempdb
can cause leaks if used incorrectly (eg. open without corresponding close)
Comments
Post a Comment