Bulk Deletes on SharePoint

Recently I had a requirement to delete a lot of items from SharePoint lists. I initially tried doing this via for loops and foreach loops. This took a long time. Then I found this article:

http://coffeeandsharepoint.blogspot.co.uk/2012/04/deleting-items-on-list-using.html

This really helped and it is surprising to note the increase in speed, however one thing to note is that I’m not certain whether this would trigger any event receivers attached to a SharePoint list in fact I’m pretty positive it wouldn’t. I’ll talk about this in another post and why that is of interest to me, right now it’s worth noting that the increase in speed is really something and has meant a slow delete hogging memory has changed into something a lot sleeker and quicker.

EDIT

I was wrong. It does appear to trigger the event receivers attached to the SharePoint list. Maybe that’s because my code calls list.Update and this detects the deleted items.

Advertisements