Is their any way to get the specific columns from the result set of stored procedure
eg SELECT COL1,COL2 FROM EXEC SP_NAME
Is their any way to get the specific columns from the result set of stored procedure
eg SELECT COL1,COL2 FROM EXEC SP_NAME
Something like this (using the self-linked server trick):
Select *
from openquery(
MyLocalServer, 'exec mydbo.dbo.myStoredProc @Param=1'
)
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