create table table_test(id int,code varchar(10))alter table table_test add name varchar(20)exec sp_configure 'allow update',1 reconfigure with overrideupdate syscolumns set colid = colid + 1 where name in ('code','name') and id = object_id('table_test') GOupdate syscolumns set colid = 2 where name = 'name' and id = object_id('table_test')exec sp_configure 'allow update',0 reconfigure with override
企业管理器谁都会呀!~
老大!
在对应sysobjects中update对应的表的字段值的顺序!
reconfigure with overrideupdate syscolumns
set colid = colid + 1
where name in ('code','name') and id = object_id('table_test')
GOupdate syscolumns
set colid = 2
where name = 'name' and id = object_id('table_test')exec sp_configure 'allow update',0
reconfigure with override