0

I am reading a book for stored procedures and they are explaining cursors inside it but i didn't happen to find a decent use for Cursors or a rule scenario where Cursor usage is a must.

tshepang
  • 12,111
  • 21
  • 91
  • 136
N Jay
  • 1,774
  • 1
  • 17
  • 36
  • 1
    Godo thing you didn't find a sample! You should **avoid cursors** at all costs - they're evil monstrosities, and more than 90% of the time, they're not neeed, nor are they really useful. Do your stuff **in a set-based manner** - much better approach than the **Row-by-agonizing-Row** approach used in cursors.... – marc_s Sep 01 '11 at 09:24

1 Answers1

0

You can use cursors when you want to loop on a result set from a select statement to do something with each row. It is like the foreach in any programming language.

Samir Adel
  • 2,691
  • 2
  • 15
  • 16