if not exists (select * from dbo.syscolumns where id = object_id(N'[dbo].[表2]') and name = 'age1')
ALTER TABLE 表2 ADD age1 int
if not exists (select * from dbo.syscolumns where id = object_id(N'[dbo].[表2]') and name = 'age2')
ALTER TABLE 表2 ADD age2 int
ALTER TABLE 表2 ADD age1 int
if not exists (select * from dbo.syscolumns where id = object_id(N'[dbo].[表2]') and name = 'age2')
ALTER TABLE 表2 ADD age2 int
select * into temp from t1
insert into temp(NAME1,NAME2) select NAME1,NAME2 from t2
drop table t2
exec sp_name 'temp','t2'
truncate table tmp
insert into [表2](name1,name2)
select name1,name2 from [表1]
drop table [表1]
sp_rename tmp,'表1'