怎样在存储过程中建立临时表,提出数据后再删除它
fiter 2004-03-26 09:30:55 AS
BEGIN
select 书商=a.seller_desc, 经费=sum(b.fund_amount) into #temptalbe
from mark.booksellers as a inner join mark.trade_payment as b
on a.seller_id=b.seller_id
where (b.library_id=@lib_code)
and(@begin_time<=b.trade_date)
and(@end_time>=b.trade_date)
group by a.seller_id
END
因为加了#temptable提示
sybase
the 'CREATE TABLE'command is not allowed within a multi-statement
transaction in the 'tempdb' database
请同志们赐教,存储过程怎么建临时表,然后在从临时表中读取数据,然后在删除临时表。不知道临时表开销大不大,如果图书馆项目有几万记录用临时表会慢吗?