Identifiers and Collisions (M to SQL Mapping)
[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.]
All views, functions, tables, columns, constraints, and triggers created in Microsoft code name “M” have names that are supposed to be similar to the underlying table. However, SQL only supports 128-character names. If the name of an identifier is longer than 128 characters, it is truncated to 128 characters. If more than one identifier truncates to the same text then they are given unique integers at the end. How these integers are allocated is undefined.
It is possible for conflicts between auto-generated and user-generated identifiers to exist. In these cases, they are explicitly disallowed. For example, the following “M” code can create a conflict between the auto-generated join table and the declared People.Addresses
extent.
module M {
type Address {
Id : Integer32;
Street : Text;
City : Text;
State : Text;
} where identity Id;
type Person {
Id : Integer32;
Name : Text;
Addresses : Addresses*;
} where identity Id;
People : Person*;
Addresses : Address*;
[People.Addresses] : Integer32*;
}
The “M” compiler emits an error when this happens.