locked
CRM 2011 Import Organization Error RRS feed

  • Question

  • Hello Everyone,

    I am importing a CRM 4.0 organization on a clean installation of CRM 2011.

    Once we are done with mappings the users we got few warnings that we have neglected and proceeded.

    WARNINGS:

    * The primary keys in the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM primary keys.

    * The indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM indexes.

    * The stored procedures in the database are not consistent with Microsoft Dynamics CRM stored procedures.

    * Statistics were detected on the Microsoft Dynamics CRM database that are not consistent with the Microsoft Dynamics CRM database.

    * Database triggers were detected in the Microsoft Dynamics CRM database

    * Fragmented indexes were detected in the Microsoft Dynamics CRM database

    * Microsoft Dynamics CRM 3.0 callouts and custom workflow activities will be removed during the upgrade. For more information, see the Upgrade Your Code from Microsoft Dynamics CRM 4.0 to Microsoft Dynamics CRM 2011 topic in the SDK.

    Finally after neglecting those warnings, while importing it is getting failed within few seconds. The description of the error log is given below:

     Error Log:

    Microsoft.Crm.CrmException: Import Organization (Name=OrganizationName, Id=007e6a2e-ff44-486b-8e6d-b50ca56e7461) failed with Exception:
    System.Data.SqlClient.SqlException (0x80131904): Cannot find the object 'fn_GetFormatStrings', because it does not exist or you do not have permission.
      
    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.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Setup.Database.SharedDatabaseUtility.GrantReportingAccess(CrmDbConnection connection, String user)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.GrantReportingAccess(InstallDatabase database, String user)
       at Microsoft.Crm.Setup.Database.Helpers.GrantReportAccess(String user, String privReportingGroup, Guid organizationId, Boolean replaceExistingUser)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.grantAccessInternal(String sqlAccessGroup, String reportingGroup, String privReportingGroup)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.GrantAccess(String sqlAccessGroup, String reportingGroup, String privReportingGroup)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.GrantAccessOnCrmSecurityGroups(Guid organizationId, String sqlAccessGroupName, String reportingGroupName, String privilegedReportingGroupName)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.UpdateOUGroupsInDatabase(String sqlServerName, String databaseName, Guid organizationId)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Execute(Object obj) ---> System.Data.SqlClient.SqlException: Cannot find the object 'fn_GetFormatStrings', because it does not exist or you do not have permission.
       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.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Setup.Database.SharedDatabaseUtility.GrantReportingAccess(CrmDbConnection connection, String user)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.GrantReportingAccess(InstallDatabase database, String user)
       at Microsoft.Crm.Setup.Database.Helpers.GrantReportAccess(String user, String privReportingGroup, Guid organizationId, Boolean replaceExistingUser)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.grantAccessInternal(String sqlAccessGroup, String reportingGroup, String privReportingGroup)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.GrantAccess(String sqlAccessGroup, String reportingGroup, String privReportingGroup)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.GrantAccessOnCrmSecurityGroups(Guid organizationId, String sqlAccessGroupName, String reportingGroupName, String privilegedReportingGroupName)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.UpdateOUGroupsInDatabase(String sqlServerName, String databaseName, Guid organizationId)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Execute(Object obj)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Execute(Object obj)
       at Microsoft.Crm.Tools.Admin.ProgressController.ExecuteHandler()

     

    We have logged in as the administrator thorugh which we installed 2011 and SQL 2008 DB. Also, checked that the object 'fn_GetFormatStrings' is found in the tabular valued functions of the 4.0 Organization database. So, couldn;t able to find the exact cause for this issue.

    Anyone faced this kind of issue?

    Any help is highly appreciated.

     

    -Thanks


    Perfectionist
    Wednesday, June 15, 2011 1:09 PM

All replies

  • Hi,

    I think this is because of the triggers created in your CRM database.

    Please delete all the triggers before importing the organization.

    SQL org_mscrm database to check number of custom triggers and custom stored procedures using following queries:-

     select type,* from sys.objects Where type='p'

     

    select type,* from sys.objects Where type = 'TR'

     

    -By using above two commands you can see number of triggers and procedures.

    -The name of the procedures started with ‘p_ ‘ were default CRM procedures and without it were custom procedures.

    -run second command for triggers you will find custom triggers.

    -delete all custom triggers one by one using following command:-

     

    DROP TRIGGER trigger_name

    and start import the organization again.

    Regards,


    Khaja Mohiddin
    Wednesday, June 15, 2011 3:48 PM
  • Hi

    I am facing the same issue. We have added multiple add ons and seems  that they have created some unsupported way customization and due to that error get created. Finally we have decided to ask support from Microsoft. 

    Please let me know if you find any solution for same.

    Thanks,

    Mahek Shah

    Friday, October 12, 2012 7:45 AM