Everybody is saying that to avoid Cursor, then why we have cursor in sql server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rameshram7777
    New Member
    • Sep 2013
    • 1

    #1

    Everybody is saying that to avoid Cursor, then why we have cursor in sql server?

    Hi,

    Everybody is saying that to avoid Cursor in SQL Server, then why we have cursor in sql server?

    Cursor mainly for Row by row iteration, we can do it using while loop, then why cursor concepts are implemented in sql server.

    Thanks,
    Ramesh
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    The rule of thumb is avoid cursors when you CAN. Sometimes you have to use a cursor because what you want to do can't be done with non-cursor SQL only.

    Comment

    Working...