Home Forums SQL Server 2012 SQL Server 2012 - T-SQL SQL 2012 ERROR - The metadata could not be determined because statement contains dynamic SQL RE: SQL 2012 ERROR - The metadata could not be determined because statement contains dynamic SQL

  • 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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.