Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This issue is showing it a duplicate key, but when I verify I could understand that one column having varchar(5) and the insert is having more than 5 character, normally it will get truncated and will get inset. But here it is giving error.

Error 'Duplicate entry '7565371' for key 'PRIMARY'' on query. Default database: 'dbname'. Query: 'insert into dbname.tablename .....

share|improve this question

closed as off topic by John Gardeniers, EightBitTony, voretaq7 Oct 27 '12 at 17:33

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

If your data doesn't fit into your database then you've got more problems than just replication. – symcbean Jun 12 '12 at 10:25

The insert may have more than 5 characters but I'd say that after it's truncated the 5 characters remaining are what is causing your duplicate key. I'd also suggest not using a varchar for such a small field, as the overhead is just not worth the minuscule storage you're saving.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.