What is the most efficient way to delete all the items of a large list in SharePoint? The code should take Query throttling limits into consideration.
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
I took a stab at converting IAfanasov's answer into PowerShell. Seems to work for me, but would be interested in any feedback.
|
|||
|
|
|
The most efficient way to a lot of transaction in SharePoint is using of SPWeb.ProcessBatchData method. For deleting operations there are very helpfull post. Code exaple from that post:
|
|||||||||||||||
|
|
I like IAfanasov's response. But you are asking about the "most efficient way to delete all the items of a large list". The most efficient way is to delete the list and re-create it, if you really want to delete all items. It will be a lot quicker than doing any iterative actions. |
|||||||||||
|