duplicate value unable to insert in int column

i have a table like this

 Boubcer_id(int)   FratId(int)
 1                 2
 2                 3

when i run query like this

 insert into bouncer_tbl(bouncer_id,frat_id)

I am getting #1062 - Duplicate entry '1' for key 1

can any one guide me correct way declare columns

Thanks for advance

more ▼

asked Nov 20, 2012 at 06:40 AM in Default

avatar image

30 1 1 4

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You have tagged your question with both Sql-Server-2005 and MySql. The error message looks like MySql, which I'm not very good at, but I'll give it a shot.

It looks on the error message like you have a unique constraint or a primary key constraint (having the same effect in this case) on the column Bouncer_Id. In that case, it's logical that you can't insert a duplicate value. If bouncer_id should not be unique, change or drop the constraint on the column.

more ▼

answered Nov 20, 2012 at 07:08 AM

avatar image

Magnus Ahlkvist
22.5k 20 43 43

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 20, 2012 at 06:40 AM

Seen: 1036 times

Last Updated: Nov 20, 2012 at 07:08 AM

Copyright 2018 Redgate Software. Privacy Policy