question

Ajay516 avatar image
Ajay516 asked

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) values('1','7') I am getting #1062 - Duplicate entry '1' for key 1 can any one guide me correct way declare columns Thanks for advance
sql-server-2005mysql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
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.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.