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.
When
you try to upgrade Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.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 3.0 foreign key constraints.
Additionally, you see one or more of the following details if you
view the installation log file. You see the following details if you deleted a foreign key:
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
You see the following details if you added a constraint:
10:35:45|Warning| remark: added unique constraint on column
10:35:45|Warning| tablename:<TableName>
10:35:45|Warning| columnname:<ColumnName>
The
<TableName> placeholder is a placeholder for the actual table name. The
<ColumnName> placeholder is a placeholder for the actual column name.
NotesUpgrade Microsoft CRM 1.2 to Microsoft Dynamics CRM 3.0
This problem occurs because the foreign keys and the references to the foreign keys are missing from the Microsoft CRM 1.2 tables. Or, this problem occurs because constraints were manually added to the Microsoft CRM 1.2 tables.
Upgrade Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.0
This problem occurs because the foreign keys and the references to the foreign keys are missing from the Microsoft Dynamics CRM 3.0 tables. Or, this problem occurs because constraints were manually added to the Microsoft Dynamics CRM 3.0 tables.
Resolution 1: The foreign keys and the references to the foreign keys are missing
To resolve this problem, run the following script to add the
foreign keys to
the Microsoft Dynamics CRM 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)
Resolution 2: Constraints were manually added
To resolve this problem, delete the constraints that were manually added to the Microsoft Dynamics CRM tables. To do this, follow these steps:
- Start SQL Enterprise Manager.
- Expand Microsoft SQL Servers, expand SQL Server Group, expand the instance of SQL Server that contains the Microsoft Dynamics CRM databases, and then expand Databases.
- Expand the OrganizationName_MSCRM database, and then click Table.
- In the list of tables on the right side of the window, right-click the table name that is mentioned in the log, and then click Design Table.
- Search the Column Name field for the column name that is mentioned in the log. Right-click the column name, and then click Check Constraints.
- Click Delete to delete the manually created constraint.