Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid cursor

Status
Not open for further replies.

mikewiltshire

Programmer
Aug 23, 2001
1
US
Hi,

I need to step through the results of a SELECT one row at a time but do not want to use a CURSOR. Is there another way?

Using a 'work' table maybe? or SELECT TOP 1 and then setting a flag when youre done?

any help would be very appreciated,

thanks,
mike.
 

There are probably several ways to perform your task. I just don't know what to suggest because you provided no detail.

I avoid cursors as much as possible. Most problems can be handled with sets and relations. But in T-SQL I can't think of a better way to step through a record set, one record at a time, when required to do that. Why the aversion to cursors in this case? Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top