Error: Violation of PRIMARY KEY constraint '. Cannot insert duplicate key in object

  • Hi master,

    am getting this error when trying to upload a file

    this error say that same record exists in your database.

    so you can't insert duplicate record again...

    i have tried even deleting all records in that table but nothing

    Please help

  • That means there are two or more records in the file that have the same primary key value.

    To be more specific, we'd need at least to see the table definition.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • the table has two columns reference number and date and the Ref no is the primary key

    [Refrence Number]intUnchecked

    DateuploadeddatetimeChecked

  • change the "reference number" to auto-increment which will take care to generate the unique number everytime.

    ----------
    Ashish

  • Thanx man,it worked.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply