Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting contents from a table returned by sp

Status
Not open for further replies.

dky1e

Programmer
May 4, 2002
293
US
Is there a way to get the contents of a table returned by a stored procedure?

For example if I have a sp:
create procedure test
as
select 'test'

how can i get at the returned table from the sp from another sp?
I want to do something like: "select * from test"
 
If you are using SQL Server you can insert the result set from a stored proc into a table or temp table.

Create table #temp(<column definitions to match SP result set>)

Insert #temp
Exec Test

It is best to post quetion like these in the forum for your database rather than this general ANSI SQL forum. Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Thanks! I'll try it first thing tomorrow.

PS
I thought i was posting to sql server forum, i must have clicked on the wrong link...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top