Delete multiple records on large tables

Luiz Lucena
Mega Sage

Hello everyone, hope all of you and your families are safe!

Here is the issue we are facing. We use SCCM import to populate workstations data into ServiceNow.
One of the data source is Network information. It works fine except for millions of Network Adapters with a name NdisWan, no IP Address and each computer containing more than 100 of these adapters with different MAC addresses.

We are trying to implement what is described here:
https://community.servicenow.com/community?id=community_question&sys_id=a5b10f69db98dbc01dcaf3231f96...

But before, we need to clean up the house. Tried to delete multiple records, using a background script (as the one mentioned at ServiceNow Elite). 

However, the script is taking too long to run our DEV instance, more than 3 hours, when I cancelled and it just deleted around 25000. Also, the instance became impossible to use, even for other activities opened in other tabs.

Cannot delete the whole content on that table as it holds other adapters information for servers, otherwise I would delete the entire content on that table.

Anyone has a better approach?

5 REPLIES 5

Matt102
Giga Guru

fwiw I was looking for help on a large table update and stumbled across https://hi.service-now.com/kb_view.do?sysparm_article=KB0780755 aka 'Safety Tips for writing Background Scripts'. Came to the section entitled "Run as a scheduled script, splitting the data sets, and limit()" and thought of this question.