DB: To use identity column or not?

前端 未结 4 836
遥遥无期
遥遥无期 2021-02-06 08:33

While designing a table my colleague here says that I should avoid identity column as it is specific to SQL Server and MS Access, But I differ with his views as it makes my codi

4条回答
  •  没有蜡笔的小新
    2021-02-06 08:52

    Use Identity column!

    It does separate your "Application Logic" from "Business Logic."

    Let's say you use "email" as primary key (which does make sense in term of "business logic"). You'll get into trouble when that email no longer exists and your user wants to edit your email.

提交回复
热议问题