两个相同的表结构,临时表和内存表结构相同,
临时表里有100条记录, 我要过滤出一些内容。
结构如下.
#temp(有 100条记录)
dh(char(10)), cbh (char(6)),money (float)
@temp的结构的上面完全一样.
把#temp中cbh is not null的记录添加到@temp中。
因为@temp不支持 insert into @temp.
不用游标.
declare @temp table (......)
insert @temp select * from #temp where cbh is not null
create table #aaa (a char(1))
insert #aaa values (1)
declare @aaa table (a char(1))
insert into @aaa select * from #aaa
drop table #aaa
declare @temp table (dh char(18) primary key,[char] char(30),[money] float)
insert into @temp select * from #temp
insert into @temp select * from #temp--第二个会报错