all groups > sql server connect > june 2004 >
You're in the

sql server connect

group:

Violation of UNIQUE KEY constraint



Violation of UNIQUE KEY constraint Nirm
6/22/2004 6:04:04 PM
sql server connect: Hi Guys
I am trying to import data to a user table using DTS
Import/Export Wizard in SQL 2000 Server from MS Excel
2002, the table has 800 plus rows of data. Necessary
Identity, Seed and Increment in table design have been
set. However, data fails to import. I tried importing the
view and then exporting back to Excel and when try to
import in user table it throughs error:-

Error at Destination fro Row number 12773. Errors
encountered so for in this task: 1
The statement has been terminated.
Violation of UNIQUE KEY constraint 'IX-tblUser'. Cannot
insert duplicate key in object 'tblUsers'

Any help will be highly appreciated
Re: Violation of UNIQUE KEY constraint John Bell
6/23/2004 9:03:29 AM
Hi

Try loading the file into a copy of the table (loading table) that does not
contain have the unique constraint. You can then check (write some SQL) to
see what row has the data that will violate the unique contraint
'IX-tblUser' by comparing the data in the loading table and to tblUsers and
within the loading table itself.

Please post DDL ( CREATE TABLE statements (including indexes and keys)) if
you wish for more detailed information.

John

[quoted text, click to view]

AddThis Social Bookmark Button