SQL Coding Myth

Sql is not very good at loops.
(Example given were Cursors and while loops)
I stated that is BS because when it comes down to it, a loop is just a JMP statement in assembly. What is done inside of the loop is what matters.

Using cursor must be avoided al all cost.
It is true that cursor are not good choice when you want to use it on heavy data loading and processing but cursor is feature that has its own purpose.  It is convenient to use cursor when you want something like examining the data. If the task of using cursor will be for 1 time occurrence rather than with regularity it is not bad to use cursor just to go with the flow and not be distracted by well structured query requirement.

No comments: