When you update the primary key column of the primary key table in Microsoft SQL Server 2005 by changing the case of the existing column values or by padding column values, you receive the following error message:
Msg 547, Level 16, State 0, Line 1
The UPDATE statement conflicted with the REFERENCE constraint "<Constraint>". The conflict occurred in database "<Database name>", table "<Table name>", column '<Column name>'.
For example, this problem occurs in both the following situations.The UPDATE statement conflicted with the REFERENCE constraint "<Constraint>". The conflict occurred in database "<Database name>", table "<Table name>", column '<Column name>'.
Example 1
- You create two tables by using a case-insensitive collation such as the SQL_Latin1_General_CP1_CI_AS collation.
- You build a primary key and foreign key relationship between these two tables.
- You update the primary key column of the primary key table by changing the case of the existing column values.
Example 2
- You create two tables.
- You build a primary key and foreign key relationship between these two tables.
- The ANSI_PADDING setting is set to OFF.
Note By default, the ANSI_PADDING setting is set to OFF. - You update the primary key column of the primary key table by padding the column values.