身份列与主键 [英] Identity column Vs Primary Key

查看:169
本文介绍了身份列与主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何决定继续使用身份"列或主键?

How can we decide on to go with Identity column or Primary Key?

推荐答案

这两个概念不是互相排斥的.所有组合都是可能的:

The two concepts are not mutually exclusive. All combinations are possible:

  • 身份列也是主键,
  • 不是主键的标识列,
  • 不是身份的主键列
  • 既不是主键也不是身份的列

请注意,身份列通常被用作主键,因为它保证是唯一的,并且通常是必填模式字段的补充,因此,如果模式更改,它也不会更改.

Note that an identity column is often used as a primary key as it is guaranteed to be unique, and it is usually in addition to the required schema fields, so it will not ahve to change if the schema changes.

这篇关于身份列与主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆