--A)建立和撤销自动增长列--(在现有表结构中新增字段)
/*撤消主键*/
alter table [Student] drop primary key (S_id)
/*增加主键*/
alter table [Student] add primary key (S_id)
go
alter table xyf_成品出口耗用保税料件明细 add Pkey int primary key identity(1,1)
go
--B)新建表结果中添加自动增长标识列

create table MyTable
(
      Id           int                 primary key identity(1,1),--主键,自动+1
      name      varchar(20)    unique not null,--不允许重复,不允许为空
      Age        tinyint,
      Dates     smalldatetime default getdate()
)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-08-31
  • 2021-06-02
  • 2022-01-19
猜你喜欢
  • 2022-02-23
  • 2021-07-05
  • 2021-05-30
  • 2021-09-29
  • 2022-03-05
相关资源
相似解决方案