我可以在同一字段中同时使用identity(1,1)和主键吗? [英] can i use both identity(1,1) and primary key for same field?

查看:108
本文介绍了我可以在同一字段中同时使用identity(1,1)和主键吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建表样本(cusid int identity(1,1)主键)

create table sample(cusid int identity(1,1) primary key)

推荐答案

是的.

标识列通常与PRIMARY KEY约束结合使用,以用作表的唯一行标识符.
Yes you can.

Identity columns are generally used in conjunction with PRIMARY KEY constraints to serve as the unique row identifier for the table.


这篇关于我可以在同一字段中同时使用identity(1,1)和主键吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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