declare table @ta(a int,b int c int) insert into @ta(1,1) --这是往表@ta中插入一条纪录 insert into @ta(1,2)declare table @tb(d int,e int) insert into @tb(d,e) select a,b from @ta --这是往表@tb中插入多条纪录 --先将表@ta中的多条纪录选择出来(select a,b from @ta) --然后插入@tb中对应的字段,必须保证插入的字段列数相等,类型匹配
insert into @ta(1,1) --这是往表@ta中插入一条纪录
insert into @ta(1,2)declare table @tb(d int,e int)
insert into @tb(d,e) select a,b from @ta
--这是往表@tb中插入多条纪录
--先将表@ta中的多条纪录选择出来(select a,b from @ta)
--然后插入@tb中对应的字段,必须保证插入的字段列数相等,类型匹配