I'm trying to find a solution to retrieve the a error message from MS Analysis Services when executing a query from SQL server.
Currenty the only message I see when executing the query is "Could not execute statement on remote server 'SSAS_SERVER_NAME', which I retrieve and log using the SQL ERROR_MESSAGE() function. The real reason for the failure is however not provided by teh ERROR_MESSAGE() function.
I use the following syntax for executing the xmla:
EXEC (@xmla) AT SSAS_SERVER_NAME
I see there there is some mention of using EXEC sp_executesql. Can I use this stored procedure to execute the @xmla on the linked server somehow? The syntax below unfortunately does not work.
EXEC sp_executesql (@xmla) AT SSAS_SERVER_NAME