Delimited Identifiers (OLE DB)

When used in the context of a DBMS, identifier denotes any object name that appears in the schema. For example, the cube name is an identifier, as is the dimension name, hierarchy name, level name, member name, property name, and so on.

Many provider implementations allow special characters in an identifier, such as the space character in the member name "Microsoft Office." Certain providers also allow language keywords to be used as object names. However, it is better to avoid this because the presence of such identifiers can easily disrupt a parser. In the following example, an MDX statement generates a syntax error because the text Microsoft Office.Children cannot be parsed:

SELECT Microsoft Office.Children ON COLUMNS, Quarters.MEMBERS ON ROWS
FROM SalesCube

In this statement, the COLUMNS axis was intended to include all the children of the member Microsoft Office. The code needs a way to delimit the identifier "Microsoft Office." To do this, use delimit characters, which are special characters that enclose the identifier and give the parser the ability to treat everything between the delimit characters as a single token. Typically, the square bracket characters ([ ]) are used to delimit the quotation. By using square brackets as the delimit characters, the earlier expression can be rewritten as follows:

SELECT [Microsoft Office].Children ON COLUMNS, Quarters.MEMBERS ON ROWS
FROM SalesCube

Now the preceding statement can be parsed unambiguously.

Delimited identifiers should be used when sending MDX statements to the provider. They should also be used when restricting schema rowsets. Consumers, especially those working with multiple data stores, are strongly encouraged to delimit all identifiers used in an MDX statement or in a schema rowset restriction.