Rollup issue: A duplicate value cannot be inserted into a unique index.

Hello!

On the week I faced with problem when MS CRM client can`t connect into CRM SERVER. This issue you can found on the 11, 12 and 13 Rollups.

Error log message looked like that:

Error| Exception : A duplicate value cannot be inserted into a unique index. [ Table name = MetadataSchema.EntityClientStatistics,Constraint name = PK__MetadataSchema.EntityClientStatistics__000000000000071C ]    at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)



   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at Microsoft.Crm.Application.SMWrappers.CrmSqlCeCommand.ExecuteNonQuery()
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.SqlCeManager.ExecuteStepsInTransaction(SqlCeTransaction tx, String[] commands)
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.SqlCeManager.CommitChanges(ISync syncData)
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.MetadataCacheManager.IncrementVersion(Object infoObj)
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.DoSyncInternal(IOrganizationContext context)
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.DoSync(IOrganizationContext context, Boolean forceSync)
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache..ctor(IOrganizationContext context, Boolean reloadAsynchronously)
   at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.LoadCache(IOrganizationContext context, Boolean unusedHere)
   at Microsoft.Crm.Metadata.MetadataCache.GetInstance(IOrganizationContext context)
   at Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.InitializeMapiStoreForFirstTime()
   at Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.Configure(IProgressEventHandler progressEventHandler)
   at Microsoft.Crm.Application.Outlook.Config.ConfigEngine.Configure(Object stateInfo)

Solution:

1. Download SQL Server Compact Toolbox for runtime 3.5
2. Drop table MetadataSchema.EntityClientStatistics,Constraint name = PK__MetadataSchema.EntityClientStatistics__000000000000071C
3. Try  again. 

Enjoy! ;)