[thelist] SQL: Using recordsets from nested store procedures

Steve Lewis slewis at macrovista.net
Fri Nov 8 14:38:02 CST 2002


Joshua Olson wrote:

> I have a stored procedure that returns a recordset.  I want to call that
> stored procedure within another stored procedure and push the resulting
> recordset into a temp table in the outer procedure.  Anybody know how to do
> this?

IIRC you work primarily in SQL Server.  Presumably you would just

SELECT procset.column1, procset.column2, procset.column3
INTO #temptable
FROM (EXEC mystoredproc) procset

but I am not sure that you can treat the result set as a derived table
like this.  Give it a shot?

--Steve




More information about the thelist mailing list