Is there a way to get the @@SPID who called a stored procedure. i.e. SPID #59 calls stored procedure SP_MYProc which then has its own SPID #60. Can the Proc know #59 called it and use #59 as a key to some temp table. This way the proc can write data private to each of the callers. Thanks Doug
Like this Create procedure proc_1 as declare @spid int set @spid=@@spid EXEC proc_2 parameters,@spid . . . GO This way you can pass the spid of calling procedure proc_1 to called procedure proc_2