Now we know how to find all the calculation scripts in a cube by querying the DMV $SYSTEM.MDSCHEMA_MEASURES.
MDX #43–Find a MDX Calculation Script
What about all those calculated sets in the cube?
In the Adventure Works cube, there are quite many calculated sets scattered around in the Sets folder in some dimensions, as shown in the following screenshot.
How do we find out all of them and their calculation scripts using the DMVs?
Now this time we can use this DMV $SYSTEM.MDSCHEMA_SETS.
SELECT * FROM $SYSTEM.MDSCHEMA_SETS
Here is the result. The EXPRESSION field shows the calculation scripts.