Basic Types (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.]
Scalar Microsoft code name “M” types translate to scalar SQL types with the following mapping. The constraint column is used when the SQL type does not perfectly represent the “M” type- for example, when the SQL type allows a larger range of values than the corresponding “M” type. In these cases a CHECK constraint is emitted on the table restricting the range of the value, as shown in the following table.
“M” Type | SQL Type | Constraint |
---|---|---|
Integer8 |
smallint |
-128 … 127 |
Integer16 |
smallint |
|
Integer32 |
int |
|
Integer64 |
bigint |
|
Unsigned8 |
tinyint |
|
Unsigned16 |
int |
0 … 65535 |
Unsigned32 |
bigint |
0 … 4294967295 |
Decimal9 |
decimal(9,6) |
|
Decimal19 |
decimal(19,6) |
|
Decimal28 |
decimal(28,6) |
|
Decimal38 |
decimal(38,6) |
|
Single |
float(24) |
|
Double |
float(53) |
|
DateTime |
datetime |
|
Date |
date |
|
Time |
time |
|
Logical |
bit |
|
Character |
nchar(1) |
|
Text |
nvarchar(max) |
|
Text#n |
nvarchar(n) |
|
Text where value.Count <= n |
nvarchar(n) |
|
Byte |
tinyint |
|
Binary |
varbinary(max) |
|
Guid |
uniqueidentifier |
|
General |
sql_variant |
Unsupported Scalar Types
The unsupported scalar types are:
Scientific
Unsigned
Integer
Decimal
Number
Unsigned64