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 2008 Forums
 Transact-SQL (2008)
 Insert procedure output to table

Author  Topic 

keyursoni85
Posting Yak Master

233 Posts

Posted - 2011-08-05 : 05:11:01
I am using below code but..

CREATE TABLE #tmpORequests (RequestID INT, ObjectID INT)
INSERT #tmpORequests EXEC usp_getRequests @Outstanding = 1, @failed = 0
DROP TABLE #tmpORequests


But I have lots of columns returns from sp.. how can I do it above case?

Please help..

Sachin.Nand

2937 Posts

Posted - 2011-08-05 : 06:24:50
I dont think it is possible.You will have to create a local linked query and then use OPENQUERY to query the linked server and insert the values in the temp table.



EXEC master.dbo.sp_addlinkedserver @server = N'LOCAL', @srvproduct=N'LINKED', @provider=N'SQLNCLI', @datasrc=N'Your Server Instance'

Select * from OpenQuery(Local,'Exec YourSP')



PBUH

Go to Top of Page
   

- Advertisement -