Name Element (ASSL)

APPLIES TO:yesSQL Server Analysis ServicesnoAzure Analysis Services

Contains the name of the parent element.


<Action> <!-- or one of the elements listed below in the Element Relationships table -->  

Element Characteristics

Characteristic Description
Data type and length String (up to 100 characters)
Default value Varies
Cardinality 1-1: Required element that occurs once and only once

Element Relationships

Relationship Element
Parent elements Action, Aggregation, AggregationDesign, AlgorithmParameter, Annotation, Assembly, ClrAssemblyFile, Cube, CubeDimension, CubeHierarchy, Database, DataSource, DataSourceView, Dimension, DimensionAttribute, Group, Hierarchy, Kpi, Level, MdxScript, Measure, MeasureGroup, MemberProperty, MiningModel, MiningModelColumn, MiningStructure, MiningStructureColumn, Partition, Permission, Perspective, PerspectiveCalculation, ReportFormatParameter, ReportParameter, Role, Server, ServerProperty, Trace
Child elements None


Every element that is used to define an object (an instance of Microsoft SQL Server Analysis Services, a hierarchy, an attribute, and so on) has a Name element as a property. The value of a Name element has the following restrictions:

  • The value cannot contain leading or trailing spaces. If leading or trailing spaces are included in the value of a Name element, those spaces will be implicitly removed by Analysis Services.

  • The value should not contain control characters. The presence of control characters in a name is strongly discouraged and can sometimes result in XML validation errors.

    For objects created using the GetNewName method in SQL Server 2017, AMO checks for and subsequently removes any control characters, leading spaces, or trailing spaces in the name. For this reason, using GetNewName is the recommended approach for setting object names.

    However, if you set the Name property directly, the same validation checks are not performed, possibly resulting in XML validation errors. Whether an error actually occurs depends on which control character appears in the name.

    Although control characters should never be used in an object name, Analysis Services does not expressly prevent them. Previous releases of Analysis Services sometimes accepted control characters in an object name. For this reason, SQL Server 2016 Analysis Services and later will ignore control characters in an object name to avoid breaking older solutions.

  • The following reserved values cannot be used:

    • AUX

    • CLOCK$

    • COM1 through COM9 (COM1, COM2, COM3, and so on)

    • CON

    • LPT1 through LPT9 (LPT1, LPT2, LPT3, and so on)

    • NUL

    • PRN

    The following table lists additional characters that cannot be used within the value of a Name element, depending on the parent element.

Parent element Invalid Characters
Server The name must follow the rules for Microsoft Windows computer names. IP addresses are not valid.
DataSource :/\*|?"()[]{}<>
Level, Attribute Element .,;'`:/\*|?"&%$!+=[]{}<>
All other parent elements .,;'`:/\*|?"&%$!+=()[]{}<>

See Also

ID Element (ASSL)
Properties (ASSL)