|Now when I try to use OpenQuery as below, it gives me the error message as below:
Select * from OPENQUERY([MySQLServer],
'EXEC xxxx.[GL].[PopulateStageRpt129_New] @ReportId=''1-085''
, @filepath=''Database=\\xxxxxx\User.Developed.Reports\HPXR\1-085 Cancelled with Cash-Report 129_2017-10-09.xls''
, @providerversion=''Excel 12.0''')
The metadata could not be determined because statement 'exec (@selectquery)' in procedure
'PopulateStageRpt129_New' contains dynamic SQL.
Consider using the WITH RESULT SETS clause to explicitly describe the result set.
And when I use the ColumnNames as below in the query
Select * from OPENQUERY([WSQL569S],
'EXEC Saw_Raw.[GL].[PopulateStageRpt129_New] @ReportId=''1-085''
, @filepath=''Database=\\bsc\cscm\IM_PHI\Facets_Team\User.Developed.Reports\HPXR\1-085 Cancelled with Cash-Report 129_2017-10-16.xls''
, @providerversion=''Excel 12.0''
WITH RESULT SETS ([Category]
It is giving me the error as below:
OLE DB provider "SQLNCLI11" for linked server "WSQL569S" returned message "Deferred prepare could not be completed.".
Msg 8180, Level 16, State 1, Line 1
Statement(s) could not be prepared.
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near 'Category'.
I want to somehow get the column names of the stored procedures I am trying all the options anything that can help me is going to be very helpful. Thanks in advance my friends.
"There is already enough hatred in the world lets spread love, compassion and affection."
-- modified 16-Oct-17 13:54pm.