0

Is their any way to get the specific columns from the result set of stored procedure

eg SELECT COL1,COL2 FROM EXEC SP_NAME

user3085995
  • 433
  • 1
  • 6
  • 19

2 Answers2

0

Something like this (using the self-linked server trick):

Select * 
from openquery(
   MyLocalServer, 'exec mydbo.dbo.myStoredProc @Param=1'
)
jean
  • 4,159
  • 4
  • 31
  • 52
0

You can do some thing like this

create table #temp (temp_table_Schema_as_output_from_Stored_procedue)
insert into #temp
exec SP_NAME @parameters 

select COL1,COL2 from #temp