There are times, especially pre go-live when you are importing data into the system and need to clean things up. Recently I needed to remove some customers and associated contact, but I found the dirpartytable records were not completely cleaned up. The following script was used to clean up the DirPartyTable table:
static void Job_DirPartyCleanup(Args _args)
op = new SysOperationProgress();
Select count(recid) from DirPartyTable;
Select * from DirPartyTable
As with all manual data manipulates, ensure you take a data backup prior to running any scripts to protect your environment.