--创建测试环境
create table TEST
(
A varchar(20),
B varchar(20),
C varchar(20)
)
go
--允许系统标更新
exec sp_configure 'allow updates','1'
go
reconfigure with override
go
--添加D列
alter table test add D varchar(10)
--更新B,C列顺序
update syscolumns
set colid=colid+1
where colid>=2 and id=object_id('test')
--更新D列顺序
update syscolumns
set colid=2
where name='D' and id=object_id('test')
--禁用系统标更新
exec sp_configure 'allow updates','0'
go
reconfigure with override
go