Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

getting an error while running SP with OPENQUERY

$
0
0

Hello,

             I am running one openquery like,

SELECT TOP 10 query.*

FROM OPENQUERY([SERVER],'SET FMTONLY OFF; exec dbo.sp ''product'', ''age''') 

but getting an error like,

Msg 11514, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1 The metadata could not be determined because statement 'execute (@query2)' in procedure

'usp_DP_PivotedResults' contains dynamic SQL. Consider using the WITH RESULT SETS clause to

explicitly describe the result set.

Note: It is SQL Server 2012 and I read somewhere that i can use WITH RESULTS SET, but it needs column names, which are dynamic in this case so i can't use it


ANK HIT




Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>