Page 1 of 1
Mass delete using cursors
Posted: Wed Dec 28, 2011 4:33 pm
In an interview, I have been questioned as,,
is it possible to do mass delete of rows on a table using cursors.???
Posted: Wed Dec 28, 2011 9:24 pm
Yes, it is possible (depending on what is meant by "mass delete"). It should also probably not be done. . .
Posted: Wed Dec 28, 2011 10:15 pm
you do not have mass delete with a cursor.
mass delete usually refers to searched-conditions
where as with a cursor it is a positioned delete:
you can delete
row set (in which there would/could be more than one row.
basic answer, IMUO, NO.
Posted: Thu Dec 29, 2011 12:39 am
Probably my bad. . .
I was thinking of a programmer who one asked me why reading more than a million rows with a cursor and deleting most of them took so long. . .
Told him deleting rows en masse via a cursor was not a good approach.
Posted: Thu Dec 29, 2011 1:19 pm
Thanks for explanation....