|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have a table with a unique non-clustered index on it. It has the IGNORE_DUP_KEY option on. For some reason, I am getting the following error: ----------------------------------------------------------------------------- System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.table1 with unique index 'IX_table1'. Duplicate key was ignored. The statement has been terminated. ------------------------------------------------------------------------------ It says the duplicate key was ignored, yet the statement is still terminated Is this data related? Other databases in the instance are working fine, and this one was doing okay, too. We're running SQL Server 2005 SP2 with rollup 3; 64-bit; clustered; thanks for any insight . . . . traceable |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
traceable1 (thhamlin@gmail.com) writes:
> I have a table with a unique non-clustered index on it. It has the > IGNORE_DUP_KEY option on. > > For some reason, I am getting the following error: > > -------------------------------------------------------------------------- > System.Data.SqlClient.SqlException: Cannot insert duplicate key row in > object 'dbo.table1 with unique index 'IX_table1'. > > Duplicate key was ignored. > > The statement has been terminated. > -------------------------------------------------------------------------- > > It says the duplicate key was ignored, yet the statement is still > terminated > > Is this data related? It would certainly to see the table definition, including indexes. Even better the statement that gives this effect. Without that, the field is open to speculation. For instance, maybe you submit a batch which first inserts into the table with the IGNORE_DUP_KEY propery set and the duplicate key is ignored, but then the next statment violates a unique index which does not have IGNORE_DUP_KEY set. So the only advice I can give is to first double-check that the error is on an index with IGNORE_DUP_KEY. Next track down the INSERT statement and find the data that gives this error. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx |
|
![]() |
| Outils de la discussion | |
|
|