首先:

--创建测试环境
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

相关文章:

  • 2021-06-10
  • 2021-11-14
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案