Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursors
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01514874
Message ID:
01514944
Views:
58
>If you created a temp table in SP, you can not access this temp table outside the SP.
>
>That's not entirely correct. If I start a transaction from .NET, and that transaction runs stored procedure A (which creates temp table ABC), and then runs stored procedure B, stored procedure B will see the temp table.
>
>Temp table scope is based on connection, not a single stored procedure
-- MS SQL
use AllTests
go
create procedure FirstProc 
  as
insert into #Test
values ('test1'),('test2')
go

create procedure SecondProc 
  as
select * from #Test
go

-- #c
-- call next commands  from #c
create table #Test (id int identity, String varchar(10))
execute FirstProc
execute SecondProc
MartinaJ
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform