SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL 2012 ERROR - The metadata could not be determined because statement contains dynamic SQL


SQL 2012 ERROR - The metadata could not be determined because statement contains dynamic SQL

Author
Message
dtibz01
dtibz01
SSC-Enthusiastic
SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)SSC-Enthusiastic (140 reputation)

Group: General Forum Members
Points: 140 Visits: 272
Phil Parkin (9/26/2013)
At this point there do not seem to be any negative implications with switching providers.


How about this?


Thanks Phil.
gpaulocorrea
gpaulocorrea
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 146
Hi.

I had the same problem and I used the Native OLE DB\Microsoft OLE DB Provider for SQL Server as you spoke and now is working. I put also the statement SET FMTONLY OFF on the first line, before procedure call.

Thank you.
asghar786
asghar786
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 1
I have an MDX query, which I want to access from RUBY ON RAILS... so that By creating LINKED-SERVER objected I can access MDX query and can get all results (rows/columns).

SP1: Actually I have created StoredProcedure based on OPENQUERY and accessing SSAS-Cube results via LinkedServer.
Then I created another StoredProcedure based on OPENROWSET calling SP1 and can access SSAS-Cube results without passing any parameter.
But when I pass some parameter its creating error and giving me error
'Msg 11514, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
The metadata could not be determined because statement 'EXEC (@Query)' in procedure 'SP1' contains dynamic SQL. Consider using the WITH RESULT SETS clause to explicitly describe the result set.'

If I try to access SP1 direct then it is giving error.
"TinyTds::Error at /SP1 Cannot initialize the data source object of OLE DB provider "MSOLAP" for linked server "LinkedServerName"

Kindly reply. Regards
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)

Group: General Forum Members
Points: 54150 Visits: 21211
asghar786 (1/8/2016)
I have an MDX query, which I want to access from RUBY ON RAILS... so that By creating LINKED-SERVER objected I can access MDX query and can get all results (rows/columns).

SP1: Actually I have created StoredProcedure based on OPENQUERY and accessing SSAS-Cube results via LinkedServer.
Then I created another StoredProcedure based on OPENROWSET calling SP1 and can access SSAS-Cube results without passing any parameter.
But when I pass some parameter its creating error and giving me error
'Msg 11514, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
The metadata could not be determined because statement 'EXEC (@Query)' in procedure 'SP1' contains dynamic SQL. Consider using the WITH RESULT SETS clause to explicitly describe the result set.'

If I try to access SP1 direct then it is giving error.
"TinyTds::Error at /SP1 Cannot initialize the data source object of OLE DB provider "MSOLAP" for linked server "LinkedServerName"

Kindly reply. Regards


Reply to what? We have to guess your question.

As this thread has already mentioned WITH RESULT SETS, I am assuming that you've tried that already. Please describe what problem you had when you did.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
wilhelm.erx
wilhelm.erx
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 Visits: 29
Just Had the exact same issue Ugrading an old SSIS Package 2008 to SQL2016,

Changing SQL Native Client 11 OVER TO OLEDB Provider for SQL solved it for me.

Regards
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search