Groups | Blog | Home
all groups > sql server programming > november 2004 >

sql server programming : processing a SP resultset within another resultset


Anuradha
11/2/2004 11:34:04 PM
Hi,

How to access the resultset of one sp within another

thnks n rgds,
Roji. P. Thomas
11/3/2004 1:12:38 PM
Get the results of the sp to a temp table and process it.

eg.

INSERT INTO #Temp
EXEC usp_yourspname params



--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


[quoted text, click to view]

Vishal Parkar
11/3/2004 1:13:40 PM
you can transfer resultset of stored procedure to a temporary table
and then process it from temporary table.

create a temporary table first and then insert output of stored procedure
using
following syntax.

insert into <table> exec <stored_procedure>

ex:
create table #t(
spid int null,
ecid int null,
status varchar(500) null,
loginname varchar(500) null,
hostname varchar(500) null,
blk int null,
dbname sysname null,
cmd varchar(800) null)

insert into #t exec sp_who


--
Vishal Parkar
vgparkar@yahoo.co.in | vgparkar@hotmail.com

AddThis Social Bookmark Button