22,209
社区成员
发帖
与我相关
我的任务
分享
select UserId ,UserName ,Age ,Score into newtb from tb
drop table tb
select UserId ,UserName ,Age ,Score into tb from newtb
drop table newtb
create table t1(C int,A int,B int)
sp_configure 'allow updates',1
RECONFIGURE WITH OVERRIDE
update syscolumns
set colid=(select count() from syscolumns a where a.name=syscolumns.name and a.id=syscolumns.id)
where id=object_id('t1')
sp_configure 'allow updates',0
RECONFIGURE WITH OVERRIDE
select from t1
查询的时候可以缓过来,或者把老数据插入到临时表,然后重新建表。