November 8, 2025 at 12:04 pm
hi,
need to known weather fast farwand cursor is faster than a while loop made on @table variable haveing less than 15 rows that means 15 iteration.
pls tell me which one is faster.
November 8, 2025 at 4:35 pm
What happened when you tried it?
with only 15 records, I'm not sure you'll see a huge difference, but give it a try and record both times. I didn't write this to be mean or ugly, but you learn most by doing - by trying multiple options and seeing which one works best.
November 8, 2025 at 10:47 pm
but main question is why you need a cursor/while loop?
November 10, 2025 at 6:03 pm
Frederico has the best question. Do you need a loop? What's the problem and data? Can you post or mock this up?
As pietlinden noted, 15 rows might not matter, but it might. If this runs 1,000s of times a second, then maybe you care. What I'd do is test this at scale. Either over and over (loop over your loop) or add data and try 1.5mm rows. Then compare which works better.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply