Muokkaa

Jaa


Identifiers (DMX)

Applies to: SQL Server Analysis Services

All objects in Microsoft SQL Server Analysis Services must have an identifier. An object's name is its identifier. Servers, databases, and database objects such as data sources, data source views, cubes, dimensions, mining models, and so on have identifiers.

There are two classes of identifiers in Data Mining Extensions (DMX):

An object identifier is created when you define the object. You then use the identifier to reference the object. Identifiers must be 100 characters or less.

Regular Identifiers

Regular identifiers in DMX comply with the Analysis Services rules for the format of identifiers. Regular identifiers in DMX do not require delimiters. Following is an example of a DMX statement that uses a regular, non-delimited identifier:

SELECT * FROM Clustering.CONTENT;  

Rules for Regular Identifiers

Following are the rules for the format of regular identifiers:

  1. The first character of a regular identifier must be one of the following:

    • A letter as defined by the Unicode Standard 2.0. This includes Latin characters from a through z and from A through Z, and letter characters from other languages.

    • An underscore (_).

  2. Subsequent characters can be:

    • Letters as defined in the Unicode Standard 2.0.

    • Decimal numbers from either Basic Latin or other national scripts.

    • An underscore (_).

  3. The identifier must not be a DMX reserved word. Reserved words are case-insensitive in DMX. For more information, see Reserved Keywords (DMX).

  4. The identifier cannot contain embedded spaces or special characters.

You must delimit with brackets any identifiers that do not comply with these rules when you use them in DMX statements.

Delimited Identifiers

Delimited identifiers are enclosed in brackets ([ ]). Following is an example of a DMX statement with a delimited identifier that complies with those rules.

SELECT * FROM [Marketing_Clusters].CONTENT;  

An identifier that does not comply with the rules for the format of regular identifiers must always be delimited. Following is an example of DMX statement with a delimited identifier that contains a space:

SELECT * FROM [Targeted Mailing].CONTENT;  

Use delimited identifiers in the following situations:

  • When you use reserved words for object names or parts of object names.

    We recommend that you do not use reserved keywords as object names. Databases that you upgrade from earlier versions of Analysis Services may contain identifiers that include words that were not reserved in the earlier version of Analysis Services but that are reserved words forSQL Server Analysis Services. You can use a delimited identifier to refer to such an object until you can change the object's name.

  • When you use characters that are not listed as qualified identifiers.

    In Analysis Services you can use any character in the current code page in a delimited identifier; however, indiscriminate use of special characters in an object name may make DMX statements difficult to read and maintain.

Rules for Delimited Identifiers

Following are the rules for the format of delimited identifiers:

  1. Delimited identifiers can contain the same number of characters as regular identifiers (from 1 through 100 characters, not including the delimiter characters).

  2. The body of an identifier can contain any combination of characters that are used in the current code page, including the delimiting characters themselves. If the body of the identifier itself contains delimiting characters, special handling is required:

    • If the body of the identifier contains a left bracket ([), no additional handling is required.

    • If the body of the identifier contains a right bracket (]), you must specify two right brackets (]]) to represent it within the code page.

Delimiting Identifiers with Multiple Parts

When you use qualified object names, you may have to delimit more than one of the identifiers that make up the object name. You must delimit each identifier individually.

See Also

Data Mining Extensions (DMX) Reference
Data Mining Extensions (DMX) Syntax Elements
Data Mining Extensions (DMX) Function Reference
Data Mining Extensions (DMX) Operator Reference
Data Mining Extensions (DMX) Statement Reference
Data Mining Extensions (DMX) Syntax Conventions
General Prediction Functions (DMX)
Structure and Usage of DMX Prediction Queries
Understanding the DMX Select Statement