Implicit Conversion (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.]
Microsoft code name “M” allows logical values to intermingle with other scalars, but SQL does not support that. Logical expressions like == cannot be stored directly in a table, returned as a scalar or as the result of a query. “M” uses bit for that instead, so the result of == is translated into a "1" or "0." Likewise, logical values stored in tables as bits cannot be used directly in logical expressions like NOT, AND, and OR (or where clauses of queries), so “M” uses expr == 1
. Where necessary, expression conversion automatically converts between these two, as shown in the following table.
Operator | “M” Example | SQL Example |
---|---|---|
Scalar -> Logical |
|
|
Scalar -> Logical |
|
|