Suppose I have a stored procedure sp1 which call another procedure sp2 like:
create proc sp1
as
begin
CREATE TABLE #table1 (......)
Exec sp2
end
then I want to use #table1 in sp2, like
create proc sp2
as
begin
....
delete from #table1
INSERT INTO #table1
......
end
How to pass #table1 to sp2? Anywhere to do this?