Cleaning the asyncoperationbase table in MSCRM 4 part 2
PLEASE NOTE my update on this on 2009-Apr-05: http://www.kornelius.org/index.php/blog/2-news/43-cleaning-the-asyncoperationbase-table-in-mscrm-4-pt-3 I previously posted about the asyncoperationbase-table in Microsoft Dynamics CRM. In the meantime I found out, that it would take several days with 100% CPU usage on our databases server to get all records deleted with the posted method. So I decided to go into deep and do it myself. I placed the following statements to the database to delete all completed jobs: update AsyncOperationBase set deletionstatecode=2 where deletionstatecode=0 and statecode=3 and AsyncOperationBase.completedon is not null delete from workflowlogbase where AsyncOperationid in (select AsyncOperationid from AsyncOperationBase where deletionstatecode=2) update DuplicateRecordBase set DeletionStateCode=2 where asyncoperationid in (select DuplicateRecordBase.asyncoperationid from DuplicateRecordBase left join asyncoperationbase on (DuplicateRecordBase.asyncoperationid=asyncoperationbase.asyncoperationid and asyncoperationbase.deletionstatecode=0) […]