Μετάβαση στο κύριο περιεχόμενο
Υποστήριξη
Είσοδος με Microsoft
Είσοδος ή δημιουργία λογαριασμού.
Γεια σας,
Επιλέξτε διαφορετικό λογαριασμό.
Έχετε πολλούς λογαριασμούς
Επιλέξτε τον λογαριασμό με τον οποίο θέλετε να εισέλθετε.
Αγγλικά
Λυπούμαστε. Αυτό το άρθρο δεν είναι διαθέσιμο στη γλώσσα σας.

Symptoms

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.

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.

Cause

This 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.

Resolution

Service pack information

To 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 How to obtain the latest service pack for SQL Server 2005

Status

Microsoft 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 Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Χρειάζεστε περισσότερη βοήθεια;

Θέλετε περισσότερες επιλογές;

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Σας βοήθησαν αυτές οι πληροφορίες;

Τι επηρέασε την εμπειρία σας;
Πατώντας "Υποβολή" τα σχόλια σας θα χρησιμοποιηθούν για τη βελτίωση των προϊόντων και των υπηρεσιών της Microsoft. Ο διαχειριστής IT θα έχει τη δυνατότητα να συλλέξει αυτά τα δεδομένα. Δήλωση προστασίας προσωπικών δεδομένων.

Σας ευχαριστούμε για τα σχόλιά σας!

×