Last post Oct 28, 2010 08:00 AM by mudassarkhan
Oct 27, 2010 06:33 PM|isjf|LINK
I have "HUGE" stored Procedure...
so I just decided to separate this big SP to some small sp ( for easy to maintain)
I meet a problem is
in SP A
create table #tmp
then filter some data then insert into #temp
insert into #tmp
// then call sp B
exec B -- would it possible to pass my temp table to SP B? so I can do next operate in SP B
Oct 27, 2010 07:40 PM|TabAlleman|LINK
As long as you keep the same connection open, the temp table will be available to all the stored procedures you execute in that session/connection. No need to "pass" it.
Oct 28, 2010 06:42 AM|kpyap|LINK
You may refer this link:
Hope it helps.
Oct 28, 2010 06:55 AM|riswadkarharshad|LINK
Since temporary tables are created inside DB, your procedures should be able to refer to it easily. There is no need for you to pass the table from one proc to another.
Also, you can create a table variable instead of temporary table and pass it as parameter from one proc to another. Please check the below link for more information:
Oct 28, 2010 07:43 AM|D J|LINK
Yes in same connection the temp table will be available to all the stored procedures.
Generally when we create a temp table after use we drop it so if you need it in other Stored procedure do not drop it in first one instead you can do the same after using it in other stored procedure.
Hv fn [:)]
Oct 28, 2010 08:00 AM|mudassarkhan|LINK