Share via


Intrinsic Data Types

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

The Microsoft code name “M” modeling language provides a number of intrinsic data types. Intrinsic types can be concrete or abstract.

Concrete types such as Text or Integer32 are similar to data types in other languages. The “M” compiler maps the concrete type to specific types in T-SQL, such as varchar or int.

Abstract types allow a business analyst to initially define a field in general terms. Later an architect or developer can specify it more concretely. Abstract types may have a number of abstract and concrete subtypes. For example, Number includes Integer and Decimal, and Integer includes Integer32, which is a concrete type.

There are also more inclusive abstract types, such as Any or General. These types are somewhat similar to the Object class used in .NET Framework languages.

Complex Intrinsic Types

Most intrinsic types are simple or atomic, in that they are applied to a single field or value. These types all have the General type as an ancestor.

There are three intrinsic types that are compound or composite, instead of being defined by a single field.

  • Collection: Multiple occurrences of a number of values.

  • List: An ordered collection.

  • Entity: A collection of named fields that are accessed directly by name.

Note that you can have collections of entities, which are used extensively when defining extents. When compiled, a collection of entities generates a T-SQL Create Table statement.

Common Intrinsic Types

The following table shows some common intrinsic types. Those types described as abstract may have additional subtypes. For example, Integer32 is a subtype of Integer. For a complete list of all types, see "M" Types Overview ("M" Reference)

Type Super Type Abstract? Description

Any

No

All values.

General

Any

No

All values except for collections, lists, and entities.

Number

General

Yes

Any numeric value.

Decimal

Number

Yes

A fixed-point or exact number (subtypes Number).

Integer

Decimal

Yes

A signed, integral value (subtypes Decimal).

Integer32

Integer

Yes

A signed, integral value (subtypes Decimal).

Scientific

Number

Yes

A floating-point or exact number (subtypes Number).

Date

General

No

A calendar date.

DateTime

General

No

A calendar date, and time of day.

Time

General

No

A time of day and time zone.

Text

General

No

A sequence of Characters.

Character

General

No

A single Unicode character of text.

Logical

General

No

A logical flag.

Guid

General

No

A globally unique identifier.

Collection

Any

No

An unordered group of (potentially duplicate) values.

List

Any

No

An ordered collection.

Entity

Any

No

A collection of labeled values, either fields or computed values.

Null

Any

No

Contains the single value null.

For each intrinsic type, “M” defines a set of operators that are specific to that type.

Note that the names of the built-in types are available directly in the “M” language.