SQL Server 2008怎样添加自增列实现自增序号

2025-03-06 23:12:48
推荐回答(4个)
回答1:

create table #t
(
X VARCHAR(20)
)
alter table #t add 字段 int identity(1,1) -- 增加自增列

回答2:

Id int IDENTITY(1,1) primary key 自增长加主键

回答3:

Id int IDENTITY(1,1) primary key

回答4:

这个Id int IDENTITY(1,1)就可以,不一定要设置为主键