回复:临时表vs.表变量以及它们对SQLServer性能的影响
求助!!!
create procedure T1
@total int
as
create table #T (n int, s varchar(128))
insert into #T select * from num where n%100>0 and n<@total
declare @res varchar(128)
select @res=max(s) from NUM
where n<=@total and
not exists(select * from #T
where #T.n=NUM.n
)
报错: Server: Msg 213, Level 16, State 5, Procedure T1, Line 5
Insert Error: Column name or number of supplied values does not match table definition.
Server: Msg 207, Level 16, State 1, Procedure T1, Line 7
Invalid column name 'n'.