SELECT *
INTO #temp --(or @tempTable)
FROM OPENQUERY(, 'EXEC Procedure')
then apply search criteria on it.
SELECT * From #temp -- (or @tempTable)
WHERE
But the concern is the performance while dealing with huge data. Imagine your SP is returning 5 million records and your search criteria limits it to thousands records, then its really a waste time and resources. So you may need to work out different plan, something like preferring a Table-valued function over the existing Procedure.
SELECT *
INTO #temp
FROM OPENROWSET('SQLNCLI', 'Server=
;Trusted_Connection=yes;',
'EXEC
.
.
)') AS a;
for more details regarding OPERNROWSET refer [here][1] [1]:
http://msdn.microsoft.com/en-us/library/ms190312.aspx
No one has followed this question yet.