Managing size of AsyncOperationBase table in CRM 4.0
I found this (http://blogs.msdn.com/crm/archive/2008/07/29/managing-size-of-asyncoperationbase-table-in-crm-4-0.aspx) very interesting article about the size of your MSCRM database. Several GB were present in ours already, mostly because of the AsyncOperationBase table. I had the change the code to get it working on my CRM 4. I remove the part about the operationtype to delete all kind of objects, but left it for this example. Here is the result: QueryExpression expression = new QueryExpression(); expression.EntityName = EntityName.asyncoperation.ToString(); ColumnSet cs=new ColumnSet(); cs.Attributes=new string[] { „asyncoperationid“ }; expression.ColumnSet = cs; ConditionExpression cState = new ConditionExpression(); cState.AttributeName = „statecode“; cState.Operator = ConditionOperator.Equal; cState.Values = new object[1]; cState.Values[0] = (int)AsyncOperationState.Completed; ConditionExpression cCompletedon = new ConditionExpression(); cCompletedon.AttributeName = „completedon“; cCompletedon.Operator = ConditionOperator.OlderThanXMonths; cCompletedon.Values = new […]