sqlserver
mariadb

Migrate SQL Server to MariaDB

Certified — live-tested path

The converter maps 21 SQL Server column types to MariaDB. One of them changes kind on the way (UNIQUEIDENTIFIER becomes CHAR(36)); the table below lists every one. DBShifts converts the schema, copies the rows in parallel batches and checks the result with row counts and checksums.

Start SQL Server → MariaDB Migration

Free tier · no credit card

SQL Server vs MariaDB

sqlserver

SQL Server

Microsoft's enterprise relational database.

mariadb

MariaDB

the community-driven MySQL fork.

SQL Server to MariaDB data type mapping

Pulled directly from DBShifts's own conversion rules — not a general reference table, this is what actually runs.

SQL ServerMariaDB
INTint
BIGINTbigint
SMALLINTsmallint
TINYINTtinyint unsigned
BITtinyint(1)
DECIMAL(10,2)decimal(10,2)
MONEYdecimal
FLOATdouble
REALfloat
VARCHAR(255)varchar(255)
NVARCHAR(255)varchar(255)
NVARCHAR(MAX)LONGTEXT
TEXTLONGTEXT
CHAR(10)char(10)
DATEdate
DATETIMEdatetime
DATETIME2datetime
DATETIMEOFFSETtimestamp
TIMEtime
VARBINARY(MAX)LONGBLOB
UNIQUEIDENTIFIERCHAR(36)

Example: SQL Server to MariaDB schema conversion

SQL Server

CREATE TABLE orders (
  id            INT IDENTITY(1,1) PRIMARY KEY,
  customer_id   INT NOT NULL,
  total         DECIMAL(10,2) NOT NULL,
  is_gift       BIT NOT NULL DEFAULT 0,
  notes         NVARCHAR(MAX),
  reference     UNIQUEIDENTIFIER,
  placed_at     DATETIME2 NOT NULL
);

MariaDB

CREATE TABLE IF NOT EXISTS `orders` (
    `id` int NOT NULL AUTO_INCREMENT,
    `customer_id` int NOT NULL,
    `total` decimal(10,2) NOT NULL,
    `is_gift` tinyint(1) NOT NULL DEFAULT 0,
    `notes` LONGTEXT,
    `reference` CHAR(36),
    `placed_at` datetime NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

The licensing move, and what it actually costs

Most SQL Server to MariaDB migrations are driven by licence cost rather than by any technical shortcoming. That makes the schema the easy part and T-SQL the hard part: the tables convert cleanly, and the stored procedures, functions and views are where the work lives.

Plan the assessment around procedural code, not table count. A database with 200 tables and no procedures is a short project. A database with 40 tables and 300 procedures is not, regardless of how the table conversion looks.

T-SQL constructs with no direct MariaDB equivalent

MERGE has no MariaDB equivalent and is rewritten as INSERT ... ON DUPLICATE KEY UPDATE, which behaves differently when several unique keys could match. Table-valued parameters have no equivalent at all and usually become a temporary table plus a second call. CROSS APPLY becomes a lateral join, and OUTER APPLY needs a left join written by hand.

Identifier quoting changes from square brackets to backticks, and the string concatenation operator changes from + to CONCAT, which matters because + on strings in MariaDB is arithmetic and silently returns 0 rather than raising. That last one is the classic post-migration bug: no error, wrong answer.

TOP becomes LIMIT, and the ordering semantics differ when no ORDER BY is present. Any query relying on TOP without ORDER BY was already undefined and will now be undefined differently.

Collation and case sensitivity will bite

SQL Server databases are frequently created with a case-insensitive collation, so WHERE name = 'smith' matches 'Smith'. MariaDB's utf8mb4_general_ci is also case-insensitive, so that behaviour usually survives, but a database created with a case-sensitive SQL Server collation will change behaviour if it lands on a case-insensitive MariaDB collation, and duplicate key errors on load are the first symptom.

Check collation before the load rather than after. A unique index that accepted 'ACME' and 'Acme' as distinct values on the source will reject one of them on a case-insensitive target, and that failure arrives as a constraint violation on an otherwise clean migration.

SQL Server → MariaDB conversion notes

Engine-specific rules baked into the conversion and transfer pipeline — verified by live certification of this exact pair.

  • TINYINT is unsigned (0–255) in SQL Server — DBShifts widens it on signed targets so 128–255 don't clip.
  • UNIQUEIDENTIFIER, DATETIMEOFFSET, MONEY and NVARCHAR(MAX) all have explicit conversion rules per target.
  • Wrapped defaults like ((1)) and (N'foo') are unwrapped to portable literals.
  • Literal 'NULL' defaults reported by MariaDB's information schema are cleaned instead of becoming DEFAULT 'NULL' strings.
  • AUTO_INCREMENT reseed after bulk load, same as MySQL.

Frequently asked questions

Is SQL Server to MariaDB migration production-ready in DBShifts?

Yes. SQL Server to MariaDB is a certified pair: it passes the live certification suite on real SQL Server and MariaDB servers, which checks schema fidelity, row counts, type-aware checksums and paging across batches.

What happens to SQL Server types that MariaDB doesn't have?

Each gets the nearest MariaDB type the converter treats as safe: UNIQUEIDENTIFIER becomes CHAR(36). Every such decision is in the migration plan before anything runs, and any mapping can be overridden per column.

Can I keep SQL Server and MariaDB in sync after the initial migration?

Yes, until you cut over. DBShifts reads SQL Server Change Tracking, which has to be enabled on the database and on each table. With zero-downtime mode on, the tracking version is captured before the first row is copied.

Which SQL Server data types need a second look when moving to MariaDB?

The table above carries a note on 4 of them: MONEY (decimal), FLOAT (double), DATETIMEOFFSET (timestamp), UNIQUEIDENTIFIER (CHAR(36)). Analysis flags the same columns on your own schema before any data moves.

Go deeper

Ready to move SQL Server to MariaDB?

Set up in under two minutes. Validation and rollback included.

Start Free Migration