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
      • Temporary tables
      • External tables
      • Identity columns
      • Default values
      • Sequences
      • Unsupported system features
    • Synapse Analytics to Fabric Warehouse
      • Data types
      • Case sensitivity
      • Named procedure parameters
      • Result set limiting
      • MERGE statements
      • Temporary tables
      • External tables
      • Identity columns
      • Default values
      • Materialized views
      • Create table as select (CTAS)
      • Unsupported system features
    • 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
  • Microsoft training - SQL Tran
    • Introduction
    • Licensing plans
    • Deploying and activating
    • Creating a new project
    • Exploring the Overview screen
    • Inside the Workspace screen
    • Code translation and emulations
      • Data type emulation
      • Case sensitivity emulation
      • Named parameters emulation
      • Result set limiting emulation
      • Merge statements emulation
      • Identity column emulation
      • Default values emulation
      • Detection of unsupported features
Powered by GitBook
On this page
  • Code example
  • Training video example
  1. Microsoft training - SQL Tran
  2. Code translation and emulations

Data type emulation

PreviousCode translation and emulationsNextCase sensitivity emulation

Last updated 8 hours ago

Data type differences are a major source of incompatibility when migrating from Synapse Analytics to Fabric Warehouse.

Synapse supports a broad set of SQL Server-compatible types, including Unicode and legacy data types, while Fabric Warehouse uses a simplified, optimized type system tailored for distributed analytics.

Many commonly used types in Synapse — such as NVARCHAR, NTEXT, and DATETIMEOFFSET — are not supported or behave differently in Fabric. These differences can lead to deployment failures or unexpected runtime behavior if not properly handled.

SQL Tran automatically resolves these incompatibilities by converting unsupported Synapse data types into their closest Fabric equivalents.

For example, NVARCHAR is translated into VARCHAR with doubled length to maintain character capacity under UTF-8 encoding, and MONEY is converted to a fixed-precision DECIMAL type.

This intelligent translation ensures that migrated schemas retain their original behavior without requiring manual intervention — a process that would be time-consuming and error-prone if done by hand.

By automating data type adjustments across all objects in the database, SQL Tran significantly reduces migration effort and risk, enabling fast and reliable transitions to Fabric.

(For more information, see the following emulation reference page: )


Code example

Synapse Analytics:

CREATE TABLE SampleDataTypes (
    ID INT NOT NULL,
    Name NVARCHAR(100),
    Description NTEXT,
    CreatedAt DATETIMEOFFSET,
    RegisteredAt DATETIME,
    BirthDate DATE,
    LastLogin DATETIME2,
    Score FLOAT,
    Balance MONEY,
    IsActive BIT,
    Document VARBINARY(MAX),
    UserID UNIQUEIDENTIFIER,
    PriorityLevel TINYINT
);

Fabric Warehouse (generated by SQL Tran):

CREATE TABLE SampleDataTypes (
    ID INT NOT NULL,
    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,
    PriorityLevel SMALLINT /* SQLTRAN FIX: TINYINT */
);

Training video example

In the example shown, SQL Tran automatically transforms the data type NVARCHAR(50) to VARCHAR(100).

The length is doubled to maintain character capacity under UTF-8 encoding, ensuring compatibility with Fabric’s storage system.

All other attributes are carefully adjusted to align with Fabric's requirements.

Data types
Data type adjustments in translated SQL