Reasons not to use an auto-incrementing number for a primary key

前端 未结 16 2658
南旧
南旧 2020-12-29 06:02

I\'m currently working on someone else\'s database where the primary keys are generated via a lookup table which contains a list of table names and the last primary key used

16条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 06:37

    An auto generated ID can cause problems in situations where you are using replication (as I'm sure the techniques you've found can!). In these cases, I generally opt for a GUID.

    If you are not likely to use replication, then an auto-incrementing PK will most likely work just fine.

提交回复
热议问题