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
 Transact-SQL (2000)
 stored proc result

Author  Topic 

vjay
Starting Member

2 Posts

Posted - 2002-07-25 : 20:35:20
Hi, Can we use the result of a stored procedure in FROM clause of SELECT statement ? (may be with Openquery/openrowset..?) For example, SELECT * FROM (exec Storedprocname)

any ideas ?

thanks Kumaran





Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-07-25 : 20:51:52
Hi

You have to insert the results into a temp table first.

I.e.



Create Table #MyResults (
col1 int
col2 int
)

Insert into #MyResults (col1, col2)
Exec MyStoredProcedure


Select * from #MyResults



Hope that helps


Damian
Go to Top of Page
   

- Advertisement -