locked
Error while upgrading from CRM4.0 (SQL Server 2005 SP4) to CRM2011 (SQL Server 2012) RRS feed

  • Question

  • Hi,

    I'm facing issue while upgrading from CRM4.0 (SQL Server 2005 SP4) to CRM2011 (SQL Server 2012). The log file gives following error description:

    -----------------------------------------------------------------------

    ....

    alter table [ActivityMimeAttachment_{6340de00-f1f4-4dc1-9aab-a202e8566390}]
    drop column ActivityMimeAttachmentId Message= The statistics '_dta_stat_165575628_3_2' is dependent on column 'ActivityId'.
    ALTER TABLE DROP COLUMN ActivityId failed because one or more objects access this column.
    09:18:11|   Info| CrmAction execution time; UpgradeDatabaseAction; 00:37:24.1689395
    09:18:11|  Error| Installer Complete: OrganizationUpgrader - Error encountered
    09:18:11|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed.
    InnerException:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The statistics '_dta_stat_165575628_3_2' is dependent on column 'ActivityId'.
    ALTER TABLE DROP COLUMN ActivityId failed because one or more objects access this column.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.DataUpgrade.AttachmentUpgradeDriver.ProcessSqlCommand(String sqlStatement)
       at Microsoft.Crm.DataUpgrade.AttachmentUpgradeDriver.HandleAttachmentUpgradeAfterPass1()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at Microsoft.Crm.Setup.Database.DllMethodAction.Execute()
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
    InnerException:
    System.Data.SqlClient.SqlException (0x80131904): The statistics '_dta_stat_165575628_3_2' is dependent on column 'ActivityId'.
    ALTER TABLE DROP COLUMN ActivityId failed because one or more objects access this column.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.DataUpgrade.AttachmentUpgradeDriver.ProcessSqlCommand(String sqlStatement)
       at Microsoft.Crm.DataUpgrade.AttachmentUpgradeDriver.HandleAttachmentUpgradeAfterPass1()
    ClientConnectionId:d0ddf6f3-f6bd-4148-ac50-859701dbfa7c

    --------------------------------------------------------

    Monday, October 8, 2012 1:32 PM

All replies

  • It look like custom statistics, or a custom index, have been created on the ActivityMimeAttachment.ActivityId column

    Try removing the statisttics with the following SQL command:

    drop statistics ActivityMimeAttachment._dta_stat_165575628_3_2
    


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Tuesday, October 9, 2012 6:20 PM
    Moderator