How to find existing partition names in cube.
I would like to check dynamically whether a partition exist or not using loop in SQL Linked server.
How to find existing partition names in cube.
I would like to check dynamically whether a partition exist or not using loop in SQL Linked server.
I'm not sure what the compatibility level that you're working with is, but for level 1200 or above the TMSCHEMA_PARTITIONS
DMV can be queried from an OPENQUERY
linked server connection for tabular models. The Name
column will need to be escaped using double brackets as done below. If the model is below compatibility level 1200, I'd recommend using the other answer provided by @vercelli for the DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS
DMV which can also be queried from a linked server.
SELECT
*
FROM OPENQUERY(LinkedServer,
'SELECT
[Name]
FROM $SYSTEM.TMSCHEMA_PARTITIONS')