Error message when you try to upgrade Microsoft CRM 1.2 to Microsoft Dynamics CRM 3.0 by using the upgrade wizard: "The foreign key constraints in the Microsoft CRM database are not consistent with Microsoft CRM 1.2 foreign key constraints" (919641)



The information in this article applies to:

  • Microsoft CRM 3.0

SYMPTOMS

When you try to upgrade Microsoft CRM 1.2 to Microsoft Dynamics CRM 3.0 by using the upgrade wizard, you receive the following error message in the Upgrade Diagnostic Wizard window:
The foreign key constraints in the Microsoft CRM database are not consistent with Microsoft CRM 1.2 foreign key constraints.
Additionally, you see the following details if you view the installation log file:
09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: accountid
09:41:33| Error| referencedtablename: accountbase
09:41:33| Error| referencedcolumnname: accountid
09:41:33| Error| foreignkeyname: account_quotes
09:41:33| Error| 09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: owningbusinessunit
09:41:33| Error| referencedtablename: businessunitbase
09:41:33| Error| referencedcolumnname: businessunitid
09:41:33| Error| foreignkeyname: business_unit_quotes
09:41:33| Error|
09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: opportunityid
09:41:33| Error| referencedtablename: opportunitybase
09:41:33| Error| referencedcolumnname: opportunityid
09:41:33| Error| foreignkeyname: opportunity_quotes
09:41:33| Error|
09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: pricelevelid
09:41:33| Error| referencedtablename: pricelevelbase
09:41:33| Error| referencedcolumnname: pricelevelid
09:41:33| Error| foreignkeyname: price_level_quotes
09:41:33| Error|
09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: contactid
09:41:33| Error| referencedtablename: contactbase
09:41:33| Error| referencedcolumnname: contactid
09:41:33| Error| foreignkeyname: quote_primary_contact
09:41:33| Error|
09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: owninguser
09:41:33| Error| referencedtablename: systemuserbase
09:41:33| Error| referencedcolumnname: systemuserid
09:41:33| Error| foreignkeyname: system_user_quotes
09:41:33| Error|
09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: owningteam
09:41:33| Error| referencedtablename: teambase
09:41:33| Error| referencedcolumnname: teamid
09:41:33| Error| foreignkeyname: team_quotes
09:41:33| Error|
Note The default location of the installation log file is the following location in which the System_drive placeholder represents the actual drive of the system:

System_drive:\Documents and Settings\User\Application Data\Microsoft\MSCRM\Logs.

CAUSE

This problem occurs because the foreign keys and the references to the foreign keys are missing from the Microsoft CRM 1.2 tables.

RESOLUTION

To resolve this problem, run the following script to add the foreign keys to the Microsoft CRM 1.2 tables.

Note Before you follow the instructions in this article, make sure that you have a complete backup copy of the database that you can restore if a problem occurs.
 
Alter Table <tablename> Add Constraint <foreignkeyname>
Foreign Key <referencedcolumnname> References <referencedtablename> <referencedcolumnname> 
Notes
  • The <tablename> placeholder represents the actual table name.
  • The <foreignkeyname> placeholder represents the foreign key name.
  • The <referencedcolumnname> placeholder represents the name of the column that is referenced.
  • The <referencedtablename> placeholder represents the name of the table that is referenced.
To determine which foreign key is missing, view the setup log file.

Note The default location of the setup log file is the following location in which the System_drive placeholder represents the actual drive of the system:

System_drive:\Documents and Settings\User\Application Data\Microsoft\MSCRM\Logs.

For example, you view the following setup log:

09:41:33| Error| remark: deleted foreign key
09:41:33| Error| tablename: quotebase
09:41:33| Error| columnname: accountid
09:41:33| Error| referencedtablename: accountbase
09:41:33| Error| referencedcolumnname: accountid
09:41:33| Error| foreignkeyname: account_quotes
09:41:33| Error|
In this example, run the following script against the MSCRM database to add the foreign key to the quotebase table.
alter table quotebase add constraint account_quotes foreign key (accountid) references accountbase (accountid)

Modification Type:MinorLast Reviewed:10/9/2006
Keywords:kbtshoot kbMBSupgrade kberrmsg kbMBSMigrate kbprb KB919641 kbAudEndUser kbAudKnowledgeWorker