RE: Cannot insert duplicate key row in object <tablename> with unique index

From: Bill Cheng (billchng_at_online.microsoft.com)
Date: 07/03/04


Date: Sat, 03 Jul 2004 06:02:38 GMT

Hi Brian,

Could you let me know if you need further assistance on this issue? I am
very glad to help you on this post.

Thank you,

Bill Cheng
Microsoft Online Partner Support
Get Secure! – www.microsoft.com/security
This posting is provided “as is” with no warranties and confers no rights.
--------------------
| From: "Brian Barnes" <spamme@nospam.com>
| Subject: Cannot insert duplicate key row in object <tablename> with
unique index
| Date: Thu, 1 Jul 2004 14:35:04 +1200
| Lines: 25
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <#ByxFQxXEHA.2216@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.server
| NNTP-Posting-Host: 203-109-153-145.static.ihug.co.nz 203.109.153.145
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:349470
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| Hi all,
| Basically I have 2 tables (tblEntitys and tblEntityDetailsEvent) (well
more,
| but I get the error with 2 tables) that are related based on a guid. I'm
| sure SQL server does not know this (I'm using guids extensively in this
| database), and both have a guid and date/time Primary key (as this
operates
| similar to backing up a database into another database). One table appears
| to back up fine, but the second table comes up with this error "Cannot
| insert duplicate key row in object tblEntityDetailsEvent with unique index
| 'tblEntitiestblEntityDetailsEvent'" The date time is set to date.now in
the
| web service that writes to the SQL server database and therefore there
| should be no key collisions (although there will be guids with a number of
| dates and dates with a number of guids) - this is shown in the table that
| backs up fine.
|
| Basically as this database was upsized (and then a few extra columns (the
| datetime column was added) and tables were added) from Access which did
have
| the relationship stated (I also added a diagram that stated this, and have
| since deleted it - now there are no diagrams in SQL Server), is there
| something I need to add or delete to ensure that this works? or have I
| missed somthing completely.
|
| --
| Brian Barnes
|
|
|



Relevant Pages

  • Cannot insert duplicate key row in object <tablename> with unique index
    ... Basically I have 2 tables (tblEntitys and tblEntityDetailsEvent) (well more, ... sure SQL server does not know this (I'm using guids extensively in this ... similar to backing up a database into another database). ...
    (microsoft.public.sqlserver.server)
  • Re: Trying to implent (Joe Celkos) Nested Sets, but need more data columns
    ... If GUIDs are used to identify a record ... They exist only in the current PHYSICAL STORAGE for the database. ... ROWID and other proprietary exposed physical locators are ... physical locator is not an identifier and it has no data integrity. ...
    (microsoft.public.sqlserver.programming)
  • Re: identitycolumn as pk
    ... GUIDS would solve the problem i guess but i see different problems with ... What i want to do is insert the data in the new database ... >> columns as primary keys is a commonly used technique so i bet there must ... Changing the database schema ultimately ...
    (microsoft.public.sqlserver.programming)
  • Re: Use of UNIQUEIDENTIFIER vs IDENTITY for PK with VB.NET/SQL2000
    ... This topic has been done over many times in this newsgroup, ... perform a Google search on this newsgroup & you'll get lots of opinions, ... Another advantage of GUIDs ... orderdetail) at the application layer without round-trips to the database. ...
    (microsoft.public.sqlserver.programming)

Loading