Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 resultset between stored proc.

Author  Topic 

noamg
Posting Yak Master

215 Posts

Posted - 2003-11-26 : 03:55:51
hi,
the store procedure A run a select statement. the result should be transfer to sp B.
( do not using ##table, it run in multi-connection environment)

create procedure B
as
EXEC A
go

any idea ?


Noam Graizer

SamC
White Water Yakist

3467 Posts

Posted - 2003-11-26 : 07:42:52
Use temp table #temp, not global temp ##temp.
Go to Top of Page

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2003-11-26 : 07:42:59
One option is to create a processing table (container) which contains the userid (or unique id (newid() ) and the records you need for processing, perform your processing and clean up those records


create table Container (UserID varchar(20),n int)
GO
create proc up_procA @UserID varchar(20)
as
set nocount on
--Do some kind of processing
--and insert into table
insert into Container select @UserID,1
GO

create proc up_procB @UserID varchar(20)
as
set nocount on

EXEC up_procA @userID

select * from container
delete from container where userID = @UserID
GO


exec up_procB 'SomeUser'
GO

drop proc up_procB
drop proc up_procA
drop table container
Go to Top of Page
   

- Advertisement -