Forum Discussion
Get Table information from dataset Programmatically
Thanks lbendlin. I tried that at I dont see information of actual source in response.
I still see the information about dataset tables, not the actual source SQL tables.
Now you got me really confused. Are you after the schema information?
See if this blog helps you.
https://blog.crossjoin.co.uk/2020/07/05/why-is-power-bi-running-my-sql-query-twice/
- lbendlin6 years agoSuper User
That's what I gave you with the DMV query. You need to take that M code and parse it. It contains the server, database and query.
- lbendlin6 years agoSuper User
Most likely you connected to the wrong endpoint. Different dataset maybe?
- lbendlin6 years agoSuper User
No, once you access the dataset it doesn't matter much if the query connection type is import/ direct query or mixed.
I just tried it with one of my direct query datasets and got the expected result.
As expected it will not work at all with live connections.
- Anonymous5 years agoNot applicable
I had the same problem as pgelli when using lbendlin 's suggestion of SELECT * FROM $SYSTEM.TMSCHEMA_PARTITIONS; I was receiving the DAX QueryDefinitions and not the M Query defintions (super useful, just not what I needed). What solved it for me was instead using SELECT * FROM $System.DISCOVER_M_expressions. Hopefully this saves someone else some time for this use case.