About deleting a large number of records

bonsai
Mega Sage

※Paris version

 

I want to empty a table with 2 million records.

I tried to delete Records in bulk using "deleteMultiple ()", but the instance freezes and the Records are not deleted.
Is there a limit to the number of items that can be deleted at once?
Also, is there a way to remove it efficiently?

 

1 ACCEPTED SOLUTION

subramanian
ServiceNow Employee
ServiceNow Employee

The below should work for records in excess of 2 million.

deleteMultiple();

 

Having said that if this is a recurring process there are other options in ServiceNow instance that you can explore -  Auto flush for e.g.

View solution in original post

10 REPLIES 10

Hitoshi Ozawa
Giga Sage
Giga Sage

Would recommend using Table Cleaner to run the record deletion in background and not make the instance freeze.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0780777

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694151