Re: Violation of UNIQUE KEY constraint

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John Bell (jbellnewsposts_at_hotmail.com)
Date: 06/23/04


Date: Wed, 23 Jun 2004 09:03:29 +0100

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

"Nirm" <anonymous@discussions.microsoft.com> wrote in message
news:2013901c458bd$fa946930$a401280a@phx.gbl...
> 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
> Thanks



Relevant Pages

  • RE: Has anyone had any luck compiling and running NorthwindOleDb under Visual Studio 2005 ?
    ... The sample should compile under Visual Studio 2005 by simply loading the ... sln project in VS and invoking a build. ... Are you using the old SQL CE 2.0 sample or the new sample which is ...
    (microsoft.public.sqlserver.ce)
  • Re: Eleminate duplicate items in a listbox
    ... > Are you loading from the DATABASE. ... > If 'Yes' then use DISTINCT in the SQL, bound it to listbox, you will only ...
    (microsoft.public.dotnet.languages.vb)
  • Re: DBMS For Datawarehousing
    ... SQL 2005 is really better then 2000 for a datawarehouse solution. ... the performance is really better both for ad-hoc queries and loading ...
    (microsoft.public.sqlserver.datawarehouse)
  • forms
    ... Im finding my forms loading are extremely slow. ... Also i would like the forms to load so that you cannot see the GUI being drawn. ... I do an update on the SQL DB before i close the form i am currently leaving. ...
    (microsoft.public.pocketpc.developer)
  • slow
    ... Im finding my forms loading are extremely slow. ... Also i would like the forms to load so that you cannot see the GUI being drawn. ... I do an update on the SQL DB before i close the form i am currently leaving. ...
    (microsoft.public.pocketpc.developer)