April 29, 2004 at 1:28 am
Hi ,
can you tell me how to access temp table information(values) in one stored procedure from other stored procedure
Eg.,
create table Ta
(
a varchar(10)
)
insert into Ta values('a')
Create proc sp1
as
select * into #TmpA from Ta
Creatte proc sp2
as
declare @a varchar(10)
set @a = (select * from #TmpA)
print @a
when i excute
exec sp2
it shows the following error....
Invalid object name '##TmpA'.
April 29, 2004 at 6:52 am
The temp table #TmpA is out of scope for the sproc sp2.
You can either create the temp table in sp1 as ##TmpA making it global, or call sp2 from within sp1 so that it remains in scope.
Christopher DeMeyer
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy