--发现将表里有数据时,插入的列里有数据,最后一列的数据也改变,请问如何解决?
--允许系统标更新
create table test(a int,b int,c int)
insert test
select 1,2,3 union select 4,5,6
select * from test
go
exec sp_configure 'allow updates','1'
go
reconfigure with override
go--添加D列
alter table test add D int
go
--更新B,C列顺序
update test set d=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
update test set d=null
select * from testdrop table test