>HI
>
>In foxpro I would use Cursors for various purposes.
>
>IN SQL2005 I want to create a cursor or equivalent.
>
>What do others do about this.
>
>Should I just select my results into a table which I then drop when I've done with it or is that a bad thing to do.
>
>And if it is bad why ?
>
>(this is for a process that may be run weekly or possibly daily).
>
>Thanks
>
>Nick
I do use cursors in SQL Server on rare occasions. If I need to examine a set of data and take complex actions based on individual record content, then sometimes it is easier to iterate through the records and act on each via a cursor.
Cursors have significant overhead - do not use them where performance is critical if at all possible.
Cursors can save your sanity when a task gets too complex to do using standard SQL set based commands.
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________