Sqlserver新增自增列

Posted ligl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sqlserver新增自增列相关的知识,希望对你有一定的参考价值。

if exists(select * from syscolumns 
where id=object_id(表名) and name=列名) 
begin
    alter table 表名 drop column 列名 ;
end
alter table 表名 add 列名 int identity(1,1);

 

以上是关于Sqlserver新增自增列的主要内容,如果未能解决你的问题,请参考以下文章