0

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 .....

arn
  • 91
  • 2
  • 7

1 Answers1

1

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.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109