SQL Tran Docs
  • Overview
    • About
    • Getting started
    • Object lifecycle
    • Why is there no AI inside?
    • Performance considerations
    • Security considerations
    • Assessment
    • Unlocking projects
    • Interface walk-through
    • Translation scenarios
    • Prerequisites for Azure Marketplace deployment
  • Emulation Scenarios
    • Emulation in SQL Tran
    • SQL Server to Fabric Warehouse
      • Data types
      • Case sensitivity
      • Cursors
        • Basic cursor loop
        • Cursor types
        • Fetch direction modes
        • Cursors in control flow
        • Nested cursors
        • Data modification cursors
        • Multiple cursors
        • Subqueries and filtering
      • Named procedure parameters
      • Result set limiting
      • MERGE statements
      • Computed columns
      • External tables
      • Materialized views
      • Identity columns
      • Unsupported system objects
    • Synapse Analytics to Fabric Warehouse
      • Emulations
      • Limitations
    • SQL Server to Synapse Analytics
    • Oracle to PostgreSQL
  • Project wizard
    • Source database
    • Target database
    • Wrapping up
  • Projects
    • Project list
    • Overview
    • Workspace
    • Reports
    • Tests
    • Scratch pad
    • Settings
      • Project name
      • Mapping
      • Database connections
    • Navigation
    • Object complexity
    • Static analysis
    • Translation errors
    • Exporting and importing projects
  • Workspace
    • Object tree
    • Data lineage
    • Code
    • Actions
      • Overriding source
      • Overriding target
      • Ignoring objects
  • Tests
    • Workflow
    • Configure SQL Tran
    • Connecting to databases
      • Fabric Warehouse
      • Synapse Dedicated SQL Pool
      • Azure SQL Database, Azure SQL Managed Instance, Microsoft SQL Server
    • Tables
    • Views
    • Procedures
    • Functions
    • Triggers
    • Performance tests
  • Scripter
    • About
    • Supported databases
    • SQL Server
    • Azure SQL
    • Synapse Dedicated Pool
    • Oracle
    • PostgreSQL
    • MySQL
Powered by GitBook
On this page
  • Emulation context
  • Emulation strategy
  • Code example
  • Important notes
  1. Emulation Scenarios
  2. SQL Server to Fabric Warehouse

Data types

Emulation context

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.


Emulation strategy

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:

Source type
Translated type
Notes

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.


Code example

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;

Important notes

  • 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.

PreviousSQL Server to Fabric WarehouseNextCase sensitivity

Last updated 6 days ago

Data types emulation in SQL Tran