I need one basic information regarding to SQl Cursor. Let I have created a cursor on table which have 10000 records. The cursor will execute as per their functionality and after that it will update few records.
If in any case i will cancel this query where 500 or more records will get fetch and update table. What will happen to next is cursor get rollback or not if I cancel my query in mid of execution?
asked Sep 24, 2012 at 06:36 PM in Default
Typically a cursor is row by row, so you would be executing an update statement 500 times to update those 500 records. If you cancel the job on record 501, it would roll backup record 501, not the 500 others that had already been committed. There are exceptions if the cursor is embedded into another transaction that the who thing could be rolled back. As a hunch I don't think that is your case. If you could post the code, you could get a solid answer.
answered Sep 25, 2012 at 04:16 AM