I am trying to see the MDX which is used in Cube Browser. I searched on google and once again I am being redirected StackOverflow's post [View MDX query generated while browsing a cube](https://stackoverflow.com/questions/3321453/view-mdx-query-generated-while-browsing-a-cube)

Yes, I can see the MDX but when I try to execute the same MDX (copied from Profiler and pasted in SSMS) in SSMS- Analysis server, it does not executes and gives me error. 

Am I doing something wrong here? If not, is there any other way to get the MDX out of the cube?

Thanks