Inserts and using cursors in multi-user environment (T-SQL)
Posted on 1999-06-28
I declared a cursor to move around in my table (next, prior, ...). To see modifications and deletions, I declared the cursor 'dynamic'. So if someone (another application) is changing a row, I will see it when I fetch the row.
What if another application inserts a row into the base table? I won't see it until I close and reopen the cursor.
How to manage that?
Can application 1 receive a message from application 2 to close his cursor and reopen it because application 2 inserted a row?
Or can the server send a message to all the applications connected to this database?
I can't close and reopen the cursor every time that I fetch a record :
1. I lose the current record, so I must provide a mechanism to avoid this
2. because the select statement in the cursor is complicated, opening the cursor will take some time