自增列不能直接修改,必须将原有ID列删除,然后重新添加一列具有identity属性的id字段。比如你要修改的字段名为id:
alter table 表名 drop column id
alter table 表名 add id int identity(1,1)
版权声明:本文为xx1433251330原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
自增列不能直接修改,必须将原有ID列删除,然后重新添加一列具有identity属性的id字段。比如你要修改的字段名为id:
alter table 表名 drop column id
alter table 表名 add id int identity(1,1)