Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: how to use temp table in inside a procedure called?

$
0
0

The trick to setting this up is to create the #temp1 table before creating sp2 to avoid any "object not found" resolution error while the query tree is being created.  The drop the table.

When sp2 is called by sp1, it will automatically re-resolve it's #temp1 entry to the #temp1 created in sp1.

 

  CREATE TABLE #table1 (......)

go

 


create proc sp2

as

begin

 

....

   delete from #table1

   INSERT INTO #table1

......

end

go

drop table #table1
go

 

create proc sp1

as

begin

    CREATE TABLE #table1 (......)

    Exec sp2

end


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>