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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -