Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Import of CRM 2015 Org in CRM 2016

(0) ShareShare
ReportReport
Posted on by

Hi,

I am trying to import a CRM 2015 Org in CRM 2016 and keep getting the following error.

Any suggestions would be welcome.

Thanks

Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction
InnerException:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Crm.CrmException: Error installing sp with name=p_DeleteAttributeFromIndexById
Must declare the scalar variable "@indexId". ---> System.Data.SqlClient.SqlException: Must declare the scalar variable "@indexId".
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   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.Metadata.SqlHelper.ExecuteBatches(IDbCommand sqlCommand, String sqlScript)
   at Microsoft.Crm.Setup.StoredProcedureService.InstallStoredProcedureInternal(StoredProcedureData spData, SqlExecutionContext sqlContext)
   --- End of inner exception stack trace ---

*This post is locked for comments

  • Bozkan Profile Picture
    Bozkan 5 on at
    RE: Import of CRM 2015 Org in CRM 2016

    Go to C:\Program Files\Microsoft Dynamics CRM\LangPacks\1055\sql\8\StoredProcedures\Metabase\IndexManagement\ path and find p_DeleteAttributeFromIndexById.sql file then open file and change parameter name @indexId to @indexid

    Note: At the path of 1055 folder is turkish char code. You must change path with your current language code.

  • RE: Import of CRM 2015 Org in CRM 2016

    Hi Tim,

    Thanks again for the assistance. I managed to come right. Changing the stored procedures advanced the upgrade a bit , it kept failing with similar errors. I landed up changing the SQL server collation settings. Note that simply changing the database collation settings does not work.

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Import of CRM 2015 Org in CRM 2016

    Here's a thread that seems to relate: stackoverflow.com/.../sql-server-stored-procedure-case-sensitive

    In stored procedure p_DeleteAttributeFromIndexById, is the code using different casing for the variable @indexId?

  • RE: Import of CRM 2015 Org in CRM 2016

    Hey Tim,

    I am experiencing similar problems, I tried importing the Organisation on a SQL 2014 installation and it works fine.

    I checked the SQL collation as suggested and it is set as case sensitive. I am unable to find the stored procedure in the UpdateStoredProcedures.xml file as the post suggests. Is there another file?

    I have changed the specific *MSCRM database to 'SQL_Latin1_General_CP1_CI_AS' but the server collation is still 'Latin1_General_CS_AI'

    Unfortunately I am still receiving the same error, nothing has changed.

    Thanks in advance

  • Verified answer
    Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Import of CRM 2015 Org in CRM 2016

    Take a look at the following thread and see if you're running into the same case-sensitivity issue.

    https://community.dynamics.com/crm/f/117/t/140439

  • RE: Import of CRM 2015 Org in CRM 2016

    Hi Tim,

    Thanks for the quick reply. I am upgrading using your option 1. We have a CRM 2015 installation and are testing the effort in upgrading to 2016. I installed CRM 2015 patch 0.2 prior to upgrading to 2016. Server upgraded fine without any errors. I then updated the ssrs components. I am able to create new organizations without any problems. When importing the original 2015 organization I get the error above.

    Hope this helps.

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Import of CRM 2015 Org in CRM 2016

    How are you performing the upgrade? Are you upgrading CRM 1) in-place (same servers), 2) installing CRM only to a new server and upgrade the db or 3) using a new server for both CRM and SQL Server?

    If #3, are you moving to a new version of SQL Server?  What version of SQL Server are you using for CRM 2015 and what version for 2016?

    Looking online, this error doesn't happen very often so you'll probably need to provide specific details to get help on this forum unless someone else has run into this specific issue and can provide guidance.

    The stored procedure that the upgrade process is failing on is provided with CRM (it's not a custom stored procedure) so the upgrade process is designed to be able to create the procedure without error.

    Do you know whether anyone was making changes to the out-of-box stored procedures in the CRM 2015 database?  If so, that could be the problem.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans