FIX: Insert with OPENXML Statement Generates Duplicate Key Error (295054)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
- 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="0x80040e2f" Source="Microsoft OLE DB Provider for SQL Server" Description="The statement has been terminated."?>
<?MSSQLError HResult="0x80040e2f" Source="Microsoft OLE DB Provider for SQL Server" Description="Violation of PRIMARY KEY constraint ''.
Cannot insert duplicate key in object ''."?>
CAUSE
OPENXML returns a duplicate record set.
RESOLUTIONTo 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.
STATUSMicrosoft 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.
Modification Type: | Minor | Last Reviewed: | 9/26/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbBug kbfix kbSQLServ2000sp1fix KB295054 |
---|
|