去掉自增长属性的尝试

update syscolumns set typestat =0 ,colstat=0 ,autoval =null where id=82099333

其中id是所要修改表的id
---------------------------------------------------------------

修改系统表示危险的,最好还是不要这么做。

---------------------------------------------------------------

我这里测试也可以,不过
update syscolumns set typestat =0 ,colstat=0 ,autoval =null where id=98099390
go
应该改为:

sp_configure 'allow updates', 1
GO
RECONFIGURE WITH OVERRIDE
GO

update syscolumns set typestat =0 ,colstat=0 ,autoval =null where id=98099390
go

sp_configure 'allow updates', 0
GO
RECONFIGURE WITH OVERRIDE
GO

传统做法:
1.alter table t1 add x1 int
2.update t1 set x1=x
3.alter table drop x
4.exec sp_rename 'x1','x'

Published At
Categories with 数据库类
comments powered by Disqus