Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Error extracting Description field in DAX Studio

Appreciate this is a DAX Studio question but is there a way around the error from this query?

 

select
    description
from $SYSTEM.TMSCHEMA_COLUMNS 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    This is the reason and the solution, in case anyone else has the same problem

     

    https://github.com/DaxStudio/DaxStudio/issues/60

     

    This behaviour is not specific to DAX Studio, you get the same syntax error running these queries from any other client tool. The DMVs actually use a query language called DMX which is almost SQL, but not quite.

    And I believe that "ID" and "Name" are reserved words in DMX, so if you quote these column names with square brackets they should work fine.

    eg.

    select [ID], [Name] from $SYSTEM.TMSCHEMA_TABLES
    select [ID], TableID, [Name], Expression, FormatString from $SYSTEM.TMSCHEMA_MEASURES

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Select functions give the same error.  Was hoping to do the following or similar SQL construct.

     

    select right( [Name], charindex('-',[Name])-1 ) from $SYSTEM.TMSCHEMA_PARTITIONS order by [Name]

     

    to remove the appended unique identification string.