Article ID: 959015 - Last Review: December 16, 2008 - Revision: 1.0 FIX: A conflict with the foreign key constraint occurs when you update the case of the column values in the primary key table or you pad column values in the primary key table in SQL Server 2005On This PageSYMPTOMSWhen 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>'. Example 1
Example 2
CAUSEThis problem occurs because values that are equal at the type level may be distinct at the binary level. For example, at the type level, N'a' is equal to N'A'. However, at the binary level, N'a' is not equal to N'A'. The optimization mechanism incorrectly assumes that the update operation that changes the case does not make any real changes. Therefore, the PK-FK check is unsuccessful. RESOLUTIONService pack informationTo resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:913089
(http://support.microsoft.com/kb/913089/
)
How to obtain the latest service pack for SQL Server 2005
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in SQL Server 2005 Service Pack 3. MORE INFORMATIONFor more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base: 824684
(http://support.microsoft.com/kb/824684/LN/
)
Description of the standard terminology that is used to describe Microsoft software updates APPLIES TO
| Article Translations
|
Back to the top
