There are several dynamic management views (DMVs) available for querying metadata in tabular models from SSMS (documentation here https://docs.microsoft.com/en-us/sql/analysis-services/instances/use-dynamic-management-views-dmvs-to-monitor-analysis-services?view=sql-server-2017).
My problem is I need the underlying SQL query that defines the table, in fact I need to create a list of table_name, table_query for my tabular model and I'd like to not have to do it manually as I'm dealing with 100s of table and several models.
I'm aware of the analysis services stored procedures available in external assembly that flatten the XML returned from the DISCOVER_XML_METADATA. The project on github is called ASSP (github link)
My question is, specifically which of these stored procedures would enable me to generate the list I require with a table name and corresponding SQL view (in visual studio editor this is located under Table Properties and I was able to define it when I imported the table). Preferably, I'd like the query as well but it would be okay just to have the underlying data source view name for example:
TabularModel, TabularTable, DatabaseSourceView
Additional details:
Compatibility level : 1103 (SQL Server 2012/2014 SP1)
I don't want to go to the trouble of installing external assemblies if it won't give me the information I'm after but also don't want to have to parse an XML output so this seems to be the best option to generate this list of metadata but I'm not sure if there is a built in stored proc already or if I'd need to do extensive coding.


