Is it a bad idea to use GUIDs as primary keys in MS SQL?

前端 未结 7 1462
时光说笑
时光说笑 2020-12-23 08:10

We have a system that uses UniqueIdentifier as the primary key of each of the tables. It has been brought to our attention that this is a bad idea. I have seen similar post

7条回答
  •  自闭症患者
    2020-12-23 08:23

    Personally, I'd use an int or bigint for the PK, but just put in another "Guid" column for those situations where you need an unguessable "key" for that record, and generate the Guid when you insert the row.

提交回复
热议问题