INSERT INTO t2(t2.f1,t2.f2, ...)SELECT (t1.f1, t1.f2,...)FROM t1
if exists (select name from sysobjects where name = 'T1')
drop table T1
if exists (select name from sysobjects where name = 'T2')
drop table T2
create table T1
(
XID int not null primary key,
XName nvarchar(100) not null,
XValue int not null
)
create table T2
(
HID int not null primary key,
XID int not null,
XName nvarchar(100) not null,
XValue int not null,
Method smallint not null
)
GO
insert into T1 (XID, XName, XValue) values (1, 'sdkfjs', 2)
GO
insert into T1 (XID, XName, XValue) values (2, 'dlsjdf sdfas dlfas', 100)
GO
insert into T2 (HID, XID, XName, XValue, Method)
select 1, T1.*, 2000 from T1 where XID =1
GO
insert into T2 (HID, XID, XName, XValue, Method)
select 2, T1.*, 2000 from T1 where XID =2
GO