Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error: Violation of PRIMARY KEY constraint '. Cannot insert duplicate key in object Expand / Collapse
Author
Message
Posted Thursday, July 5, 2012 6:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 5, 2012 6:47 AM
Points: 3, Visits: 2
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
Post #1325352
Posted Thursday, July 5, 2012 6:07 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Friday, June 27, 2014 12:43 PM
Points: 15,444, Visits: 9,596
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
Post #1325355
Posted Thursday, July 5, 2012 6:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 5, 2012 6:47 AM
Points: 3, Visits: 2
the table has two columns reference number and date and the Ref no is the primary key


[Refrence Number] int Unchecked
Dateuploaded datetime Checked

Post #1325366
Posted Thursday, July 5, 2012 6:29 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 12:28 AM
Points: 880, Visits: 4,084
change the "reference number" to auto-increment which will take care to generate the unique number everytime.

----------
Ashish
Post #1325374
Posted Thursday, July 5, 2012 6:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 5, 2012 6:47 AM
Points: 3, Visits: 2
Thanx man,it worked.


Post #1325384
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse