Has some 'noted authority' issued a fatwa against cursors?
Does some unspeakable evil lurk in the heart of cursors that corrupts the morals of children or something?
I can understand wanting to avoid having to use a cursor due to the overhead and inconvenience, but it looks like there's some serious cursor-phobia-mania going on where people are going to great lengths to avoid having to use one.
For example, one question asked how to do something obviously trivial with a cursor and the accepted answer proposed using a common table expression (CTE) recursive query with a recursive custom function, even though this limits the number of rows that could be processed to 32 (due to recursive function call limit in sql server).
This strikes me as a terrible solution for system longevity, not to mention a tremendous effort just to avoid using a simple cursor.
What is the reason for this level of insane hatred?
If you feel that this question can be improved and possibly reopened, visit the help center for guidance. In almost all situations (that I have come across) there is a way to replace a cursor with a better performing set based situation. statements, and the implementation is the obvious internal cursor implementation.
Using higher-level "set-based operators" bundles the cursor results into a single result set, meaning less API back-and-forth.
Cursors predate modern languages that provide first-class collections.
What I don't understand is people going waaaaay out of their way to avoid cursors like they have cooties or something, even when a cursor is a simpler and/or more efficient solution.
It's the irrational hatred that baffles me, not the obvious technical efficiencies.