Attributes (Master Data Services)

In Master Data Services, attributes are objects in entities. An attribute is a container for attribute values, and each attribute value describes a member.

You can think of an attribute as a column in an entity table. An attribute value is the value used to describe a specific member.

Entity example

In the following example, the entity has the attributes: Name, Code, Subcategory, StandardCost, ListPrice, and FilePhoto. These attributes describe the members. The members are represented by a single row of attribute values.

Entity example with sample data

When you create an entity, the Name and Code attributes are automatically created. Code requires a value and must be unique within the entity. You cannot remove the Name and Code attributes.

An attribute can be used to describe a leaf member, a consolidated member, or a collection.

Attribute Types

There are three types of attributes:

  • Domain-based attributes, which are populated by entities. For more information, see Domain-Based Attributes (Master Data Services).

  • File attributes, which are used to store files, documents, or images. File attributes are intended to help with the consistency of your data by requiring files to have a specific extension. File attributes cannot be guaranteed to prevent a malicious user from uploading a file of a different type.

  • Free-form attributes, which allow free-form input for text, numbers, dates, or links.

Numeric Free-Form Attributes

Numeric free-form attribute values are limited to the SqlDouble value type.

By default, a Double value contains 15 decimal digits of precision, although a maximum of 17 digits is maintained internally. The precision of a floating-point number has several consequences:

  • Two floating-point numbers that appear equal for a particular precision might not compare equal because their least significant digits are different.

  • A mathematical or comparison operation that uses a floating-point number might not yield the same result if a decimal number is used because the floating-point number might not exactly approximate the decimal number.

  • A value might not roundtrip if a floating-point number is involved. A value is said to roundtrip if an operation converts an original floating-point number to another form, an inverse operation transforms the converted form back to a floating-point number, and the final floating-point number is equal to the original floating-point number. The roundtrip might fail because one or more least significant digits are lost or changed in a conversion.

Attribute Example

In the following example, the Product entity contains:

  • The free-form attributes of Name, Code, StandardCost and ListPrice.

  • The domain-based attribute of Subcategory.

  • The file attribute of FilePhoto.

Subcategory is an entity that is used as a domain-based attribute of Product. Category is an entity that is used as a domain-based attribute of Subcategory. Like the Product entity, the Category and Subcategory entities each contain the default Name and Code attributes.