Microsoft KB Archive/295054

= FIX: Insert with OPENXML Statement Generates Duplicate Key Error =

Article ID: 295054

Article Last Modified on 9/26/2005

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft Data Access Components 2.6

-



This article was previously published under Q295054



BUG #: 236302 (SHILOH_BUGS)



SYMPTOMS
An attempt to use an OPENXML statement after an XML document has been mapped in memory and presented to the SQL Server server may return an error if following conditions are true:
 * An edge table or meta properties is used.
 * You are inserting data into a table with a unique key or primary key constraint.

The error that is returned resembles the following:

<?MSSQLError HResult=&quot;0x80040e2f&quot; Source=&quot;Microsoft OLE DB Provider for SQL Server&quot; Description=&quot;The statement has been terminated.&quot;?>

<?MSSQLError HResult=&quot;0x80040e2f&quot; Source=&quot;Microsoft OLE DB Provider for SQL Server&quot; Description=&quot;Violation of PRIMARY KEY constraint ''.

Cannot insert duplicate key in object ''.&quot;?>



CAUSE
OPENXML returns a duplicate record set.



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



WORKAROUND
Install Microsoft Data Access Componenets (MDAC) version 2.6 SP1 or later.



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

Keywords: kbbug kbfix kbqfe kbsqlserv2000sp1fix kbhotfixserver KB295054

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.