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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -