Lists in SharePoint is only look like database tables but not they are. For some things they are even better than databases – for common users for example, but for developers and administrators they are often not so good and friendly.

Let’s look for such a common thing in databases like "Truncate". To clear all the rows in a database table you need only to write "Truncate TABLE table_name" and execute it.

With SharePoint Lists it’s not so easy.

Some times earlier I had to delete data from list, but it was a list with small quantity of rows, about 5 or 10 thousands. But removing items from that list lasted about 10-15 minutes. It’s too long.

Recently I had to remove items from a list with 100k rows. I couldn’t even think of waiting for so long and started to look for solution.

I found a way of removing SharePoint list items using Batch.

But my task was some more difficult – I had to remove only first 90k rows of 100k. Below I write a powershell script for this action.

But it only moves items to SharePoint Recycle Bin. I will write how to clean deleted items from SharePoint Recycle Bin soon.