2007-03-27 17:27
2007-03-27 17:33
2007-03-27 17:39
通过系统表改列的物理顺序
if object_id('shiyan') is not null
drop table shiyan
go
create table shiyan(id int,name varchar(10),score int)
insert into shiyan select 1,'aa',80
sp_configure 'allow update',1
reconfigure with override
select a.name,colid from syscolumns a,sysobjects b where a.id=b.id and b.name='shiyan'
update syscolumns set syscolumns.colid=5 from sysobjects b where syscolumns.id=b.id and b.name='shiyan' and syscolumns.colid=1 --5可以随便改,只要比列的个数大的数就行
update syscolumns set syscolumns.colid=1 from sysobjects b where syscolumns.id=b.id and b.name='shiyan' and syscolumns.colid=3
update syscolumns set syscolumns.colid=3 from sysobjects b where syscolumns.id=b.id and b.name='shiyan' and syscolumns.colid=5
select a.name,colid from syscolumns a,sysobjects b where a.id=b.id and b.name='shiyan'
sp_configure 'allow update',0
reconfigure with override

2007-03-27 18:08
2007-03-28 12:23
2007-03-28 12:24
2007-03-28 13:09
2007-03-28 13:10
2007-03-28 14:37
2007-03-28 15:02