FIX: The Distribution Agent Shuts Down and Error 2627 or Error 2601 Are Generated When You Apply a Command to a Queued Updating Subscriber (323545)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q323545
BUG #: 357995 (SHILOH_BUGS)

SYMPTOMS

The Distribution Agent shuts down and SQL Error 2627 or SQL Error 2601 are generated.

SQL Error 2627:
Violation of UNIQUE KEY constraint '%.*ls'. Cannot insert duplicate key in object '%.*ls'.
SQL Error 2601:
Cannot insert duplicate key row in object '%.*ls' with unique index '%.*ls'.
You encounter this problem under the following conditions:
  • You publish an article in a transactional publication that supports queued updating subscribers.

    -and-
  • There is a unique constraint or a unique index that is defined on an article and the article contains columns for which NULL values are permitted.

CAUSE

The INSERT and UPDATE procedures, which are created by replication and which the Distribution Agent uses to apply the INSERT and UPDATE procedures to the subscriber, do not contain the proper logic to handle UNIQUE constraints that include columns that permit null values.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How To Obtain the Latest SQL Server 2000 Service Pack

NOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time          Version     Size           File name
   ------------------------------------------------------------------
   24-MAY-2002  16:58:55 PM   8.00.632    96,473 Bytes   Qfe357995.sql
				
NOTE: Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.


WORKAROUND

To work around this problem, if your business rules permit this, you can change the column definition for the columns that are included in a unique index or a unique constraint so that they do not permit NULL values.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.

Modification Type:MinorLast Reviewed:9/27/2005
Keywords:kbHotfixServer kbQFE kbSQLServ2000sp3fix kbbug kbfix kbSQLServ2000preSP3fix KB323545