急求一解决临时表的办法,详细内容如下:
set @sql= 'select mid=identity(int,1,1) , * into #mianliao from product_track_mianliao ' +ltrim(rtrim(@where))
exec(@sql)
select * from #mianliao 时,出错说,该表无效
,如果俺全局的临时表呢
set @sql= 'select mid=identity(int,1,1) , * into ##mianliao from product_track_mianliao ' +ltrim(rtrim(@where))
exec(@sql)
select * from ##mianliao 时,,每当第二次执行时,就提示,该表已经存在,
于是只有用 delete table ##mianliao ,....后,才可以执行第二次.....
因为这个储蓄过程,是有狠多个用户要用的.,,,,如果大家同时用的话,会出错的!
试问,有没有什么办法,可以解决些问题!??
------解决方案----------------------try
set @sql= 'select mid=identity(int,1,1) , * into #mianliao from product_track_mianliao ' +ltrim(rtrim(@where))
set @sql=@sql+ ' select * from #mianliao '
exec(@sql)