TSQL - A question regarding cursors
Posted on 2014-08-19
I have a stored procedure that creates a cursor and loops though a table on a specific order.
What happens if i insert a new record? Can that appear in the result when i get the next record if i insert it so it's order is directly after the one i am working with?
Basically is the set of records in returned by the cursor difined at the time the cursor is opened, or is it dynamic so changes in the database can result in these new records appearing?
I am looping through a table looking for missing records and inserting them when i find (or dont find them!). I dont want the newly insert record to appear when i get the next record.