Data types
Last updated
Last updated
SQL Server supports a rich set of data types, including Unicode strings (NVARCHAR
), legacy types (NTEXT
, MONEY
), and structured data types (XML
, DATETIMEOFFSET
).
These types are either unsupported or behave differently in Microsoft Fabric Warehouse, which is optimized for columnar, Parquet-based storage with a more constrained SQL type system.
Fabric Warehouse limits the available data types to those compatible with distributed storage and analytics workloads. Unsupported or partially supported types must be translated or removed to avoid deployment errors or runtime inconsistencies.
For example:
NVARCHAR
is not available; Fabric only supports VARCHAR
, using UTF-8 collation for Unicode.
MONEY
, NTEXT
, and XML
are not supported.
DATETIMEOFFSET
is replaced by DATETIME2
, which omits timezone data.
Without proper conversion, schema deployment or query execution would fail after migration.
SQL Tran automatically rewrites unsupported or partially supported data types to Fabric-compatible equivalents. It applies safe defaults to preserve semantic intent while ensuring compatibility.
The following are examples of how SQL Tran transforms specific SQL Server types:
NVARCHAR(100)
VARCHAR(200)
Size doubled to accommodate UTF-8 encoding.
NTEXT
VARCHAR(MAX)
Legacy type converted to unbounded string.
DATETIMEOFFSET
DATETIME2(6)
Timezone offset removed.
DATETIME
DATETIME2(6)
Standardized with explicit precision.
DATETIME2
DATETIME2(6)
Precision enforced explicitly.
MONEY
DECIMAL(19,4)
Converted to fixed-point type.
XML
VARCHAR(MAX)
Serialized as text.
Data types like BIT
, FLOAT
, DATE
, UNIQUEIDENTIFIER
, VARBINARY(MAX)
, and INT
are preserved without modification.
SQL Server:
CREATE TABLE SampleDataTypes (
ID INT PRIMARY KEY,
Name NVARCHAR(100),
Description NTEXT,
CreatedAt DATETIMEOFFSET,
RegisteredAt DATETIME,
BirthDate DATE,
LastLogin DATETIME2,
Score FLOAT,
Balance MONEY,
IsActive BIT,
Document VARBINARY(MAX),
UserID UNIQUEIDENTIFIER,
Metadata XML
);
Fabric Warehouse (generated by SQL Tran):
CREATE TABLE SampleDataTypes (
ID INT NOT NULL /* SQLTRAN FIX: PRIMARY KEY */,
Name VARCHAR(200) /* SQLTRAN FIX: NVARCHAR(100) */,
Description VARCHAR(MAX) /* SQLTRAN FIX: NTEXT */,
CreatedAt DATETIME2(6) /* SQLTRAN FIX: DATETIMEOFFSET */,
RegisteredAt DATETIME2(6) /* SQLTRAN FIX: DATETIME */,
BirthDate DATE,
LastLogin DATETIME2(6) /* SQLTRAN FIX: DATETIME2 */,
Score FLOAT,
Balance DECIMAL(19,4) /* SQLTRAN FIX: MONEY */,
IsActive BIT,
Document VARBINARY(MAX),
UserID UNIQUEIDENTIFIER,
Metadata VARCHAR(MAX) /* SQLTRAN FIX: XML */
);
GO
ALTER TABLE SampleDataTypes ADD CONSTRAINT PK_SampleDataTypes PRIMARY KEY NONCLUSTERED (ID) NOT ENFORCED;
UTF-8 collation is assumed for all VARCHAR
columns to support Unicode.
A 2x size expansion for NVARCHAR
is applied conservatively to avoid data truncation while maintaining optimal performance. You may adjust this further on a case-by-case basis if your data contains many multi-byte characters.
PRIMARY KEY
constraints are preserved in the translated output, but rewritten using the PRIMARY KEY NONCLUSTERED ... NOT ENFORCED
pattern recommended by Microsoft Fabric.
XML
is converted to VARCHAR(MAX)
, removing structure and losing support for XML features. Any existing XML logic will need to be rewritten outside Fabric.
DATETIMEOFFSET
becomes DATETIME2(6)
, losing the time zone offset. Applications that rely on time zone–aware values may require changes.
NTEXT
is converted to VARCHAR(MAX)
with encoding changed from UTF-16 to UTF-8. While content remains intact, binary differences may affect encoding-sensitive logic or legacy text access methods.