143 thoughts on “SSAS: Using DMV Queries to get Cube Metadata

  1. Hi Benny,
    Is there a way to get a result as follows :
    Table Name, Table Type [Normal / Calculated], Column Name, Column Type [Normal / Calculated / Measure], Data Type, Data Format, Expression [Measure or Calculation Dax Formula] .

    I was struggling to figure it out, how to handle Boolean Column in Where Clause, For example,
    [select * from $SYSTEM.MDSCHEMA_MEASURES WHERE MEASURE_IS_VISIBLE = True ] is returning an error, not sure how to handle it. However, Dax Studio does not give any detail of the error.

    I appreciate your kind response.

    Regards,
    Sukhomoy

  2. Hello,
    Can I get the DatabaseID, CubeID, MeasureGroupID and PartitionID via DMV from cube?
    If not is there any other way?

  3. Hello Benny,

    When querying a Multi-Dimensional SSAS , are you able to query the relationship between database source columns and dimension/measure source columns? For example, if I have measure “Gross Sales”, and in cube the TableID=”Sales” and the ColumnId=”GrossSales”, is there a DMV where I can see that relationship? (same thing for dimension columns)

    Thanks!

  4. Hi Benny,

    I am newer to SSAS. Just out of curiosity, do you know the query that I can use to find when the measure groups were last processed?

    I see this code to get the list of measure groups:
    SELECT
    [MEASUREGROUP_NAME]
    FROM $SYSTEM.MDSCHEMA_MEASUREGROUPS

    I can run this query to find out when the dimensions were last processed:

    SELECT [CUBE_NAME], LAST_DATA_UPDATE
    FROM $System.MDSCHEMA_CUBES
    where cube_source = 2

    But, I cannot find the code to see when the Measure Group was last processed. This is especially important because when the cube runs long, we would like to run a report and see what has processed and what still needs to be processed.

    Any assistance would be great! Thank you in advance.

    1. Sherri, for creating and processing dimensions I would recommend using Tabular Object Model(TOM) for tabular models or Analysis Management Objects(AMO) for multidimensional models. These libraries have methods/ attributes that report the last processed time.

  5. Hello Benny,
    Thanks a lot for DMV queries …
    By the way … Is there a possibility to get which (roles\users) have privileges access each cube into DB through Queries ???

    1. Hi Heron, did you find an answer to your question? I have the same issue..trying to extract (for all my ssas databases) roles and members for each cube..but don’t know how to link roles to cubes..

      Thanks

  6. Thanks, can I run these queries in SSDT and create a perspective out of it ? I am not able to run the query, it errors out with syntax error near ‘$’.
    Please let me know.

    Thanks
    Sujatha

  7. Hi Benny,
    I have a requirement to retrieve details of all cubes from SQL Openquery. The below query is returning data only from first database. Please help to get details of cubes from all databases.

    SELECT * FROM OPENQUERY (ADSI,’
    SELECT *
    FROM $SYSTEM.MDSCHEMA_CUBES’)

    Thanks in advance

  8. Hi Benny,
    Great Post.Can you please let me know how to get the Last process Date and Last Schema Update Date of all the Catalogs in a Server using DMV.

    I do not get all the catalogs info(Schema and Process Date) in $system.dbschema_catalogs , while for getting them I need to run individual query for $System.MDSCHEMA_CUBES in individual databases.

    Thanks

  9. Hi Benny, im a newbie at this but all im trying to do is extract a table with many columns and 3 measures in SQL studio. im struggling to get the columns i require and can only get 1 column using a MDX query. how do i get many columns?

  10. Hi , Is there any ways by which i can find out the source query of all the partition using DMVs, OR MDS in SSAS Cubes

  11. Hi Benny,

    Just want to ask if there is a way to extract the table source (physical tables/views/name query) used by the cube measures/dimensions from data source view? If yes may i ask your help to formulate as I’ve been searching on this but found no answer 🙂

    Thanks!
    Bernard

    1. Hello, just wondering if you ever found how to extract the table source used by the cube measures from the DSV?
      I have a similar requirement and I can’t find where to get this information from.

  12. Hi Benny,

    Cool post. Any idea how to use DMV against empty (not yet processed) SSAS databases?
    We want to deploy a standard solution to any SSAS instance and then dynamically (via SQL config table) drop cubes and dims.

    Cheers,
    Tom

    1. Sumanth, Measures are usually numeric and you can get the precision if numeric MDSCHEMA_MEASURES Rowset. Don’t think you can get the same info for dimensions as the key value can be different from name value.

Leave a Reply to Kenney Snell Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s