My stored procedure emit reults set which has dynamic columns, sometimes it has 10 and sometimes it has more 15 Also My stored procedure has temporary table that is return to calling app.
select a.*
into [tempdb].[dbo].[tempBase]
from openrowset('SQLNCLI', 'Server=.;Trusted_Connection=Yes;Integrated Security=SSPI', 'SET NOCOUNT ON;SET FMTONLY OFF ; exec LIQ_TradeBustTrader5895.dbo.price_report @loginID = ''ALL'', @tableName = ''order_msgs'', @firmname = ''ALL'', @AssetClass = ''All'', @OutputBustRecords=0, @ManualOrder=0, @TimeFrom=''0:0'', @TimeTo=''23:59'', @ExcludeSimulatedTrades=0, @SingleTable =1 ') AS a;
Now I get these errors:
Msg 11529, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
The metadata could not be determined because every code path results in an error; see previous errors for some of these.Msg 4902, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
Cannot find the object "#Tethys_ReportGenerator_Tbl" because it does not exist or you do not have permissions.