问题
We have 20+ tabular cubes with 300+ dimensions and was hoping to find - if there is some automated way to find what is the source for this dimension
Yes manually, I can get into Tabular model > Table Properties and can find what view and table are used to populate dimension. However not practically possible to get for 300+ dimensions.
And yes, I know some 3rd party provider such as SQL Sentry has some tools which can find that lineage.
But just wondering, is there any SSAS DMVs or any other script which can give these details?
Much appreciated for all your help
Note: Environment is On-Prem Microsoft SQL 2016 suite (SQL DB, SSAS and SSIS)
回答1:
For compatibility level 1200 or above Tabublar models the QueryDefinition
column of the $SYSTEM.TMSCHEMA_PARTITIONS
DMV will show the source SQL statement for either each partition, or the entire dimension/fact table if it isn't partitioned. In the event that a full table or view name is used (instead of a query) the full SELECT
statement will be displayed with the object name. This can be queried from either SSMS by connecting to the SSAS server and opening a new MDX/DAX query window or another tool such as Dax Studio. This DMV is specific to whatever model you're connected to, as opposed to the whole SSAS instance. In the example below the Name
column is the name of the dimension from the model. Since Name
is a keyword it will need to be enclosed in brackets.
SELECT QueryDefinition FROM $SYSTEM.TMSCHEMA_PARTITIONS WHERE [Name] = 'DimensionName'
来源:https://stackoverflow.com/questions/55056248/how-to-find-lineage-between-ssas-tabular-model-and-sql-database