Re: Temp Table and SP Advise



Ks (kpunjani@xxxxxxxxx) writes:
> I have a little scenario here, i am need of inserting some rows into a
> temp table which will be returned by a procedure... Here is little
> explanation
>
> I am planning to make a proc A and a temp table in proc A.
> I will be calling proc B from Proc A.
> What i want is the data returned by Proc B should be inserted into Proc
> A's Temp table.

Just do it. The temp table created in A, will be visible from B.

I cover this in an article on my web site:
http://www.sommarskog.se/share_data.html

--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: Performance issues with stored procedure
    ... Measure both in and out of the proc. ... Wayne Snyder, MCDBA, SQL Server MVP ... > The proc is not very advanced, it involves creating a temp table, filling ... A couple of UDF's are used when filling the temp table. ...
    (microsoft.public.sqlserver.server)
  • Ongoing Saga Dell PE1850 - FreeBSD 6.0 Release Freezups.
    ... Extensive memory and mainboard diagnostics have been run. ... Ambient Temp | 29 degrees C | ok ... ECC Uncorr Err | Not Readable | ns ... PROC Protocol | Not Readable | ns ...
    (freebsd-questions)
  • Re: on exception in SPL
    ... The stored proc is executes fine first. ... that the table you drop is only a temp table. ... The System therefore regenerates the sysprocplan ... For the time the sysprocplan is regenerated (and in a transaction until ...
    (comp.databases.informix)
  • Re: How to find query plan for a stored procedure using temporary tables
    ... with temp tables to hold intermediate results. ... Create temp tables at the start of the stored proc. ... number of recompiles (and at 2000+ lines, ... get an execution plan for each step, and also to try different versions ...
    (comp.databases.ms-sqlserver)
  • Re: get some records and then call a stored proc once for each??
    ... I have an AssignRep Stored proc. ... I would suggest you use a cursor if you have to loop through a set ... > right kind of cursor (fast forward is usually acceptable for a temp table) ... >> exec foo 3 ...
    (microsoft.public.sqlserver.programming)