如何用SQL语句给表里加主键加索引

2025-02-26 06:13:27
推荐回答(1个)
回答1:

create
table
(
id
int
identity(1,
1)
not
null
primary
key,
other_column
varchar(50)
)
--
对表设置主键的同时,数据库会自动的创建一个以主键作为名称的唯一索引的。