alter修改表中某列为自动增长列

  删除那列,再建一列。要不就需要去企业管理其中修改这列的数据类型为自动增长的了。
  因为sql server不支持在自增列与非自增列之间进行转换。可以观察一下企业管理器中这种调整的处理, 它也无法用alter 语句直接完成。
+展开
-SQL
alter   table   tablename   drop   column   n1
go
alter   table   tablename   add   n1   int   identity(1,1)


来源:http://topic.csdn.net/t/20060601/12/4793570.html

加支付宝好友偷能量挖...


评论(0)网络
阅读(187)喜欢(0)SQL及数据库