Jayraj Chhaya

Jayraj Chhaya

  • 345
  • 5k
  • 72.4k

Where we use Cursor and While loop in Store Procedure ?

Oct 2 2022 12:41 PM

Hi,
I want to fetch some data row by row and some operations perform on each row so, suggest to me which one is better for that case and why?

Is cursor better or While loop in Store procedure?

ex - 

  1. I want to cumulative frequency from the data
  2. I want to copy each row in separate temp table. 

Answers (2)