Migrate SQL Server to MySQL
Certified — live-tested pathThe converter maps 21 SQL Server column types to MySQL. 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.
Free tier · no credit card
SQL Server vs MySQL
SQL Server
Microsoft's enterprise relational database.
MySQL
the world's most deployed open-source relational database.
SQL Server to MySQL data type mapping
Pulled directly from DBShifts's own conversion rules — not a general reference table, this is what actually runs.
| SQL Server | MySQL |
|---|---|
| INT | int |
| BIGINT | bigint |
| SMALLINT | smallint |
| TINYINT | tinyint unsigned |
| BIT | tinyint(1) |
| DECIMAL(10,2) | decimal(10,2) |
| MONEY | decimal |
| FLOAT | double |
| REAL | float |
| VARCHAR(255) | varchar(255) |
| NVARCHAR(255) | varchar(255) |
| NVARCHAR(MAX) | LONGTEXT |
| TEXT | LONGTEXT |
| CHAR(10) | char(10) |
| DATE | date |
| DATETIME | datetime |
| DATETIME2 | datetime |
| DATETIMEOFFSET | timestamp |
| TIME | time |
| VARBINARY(MAX) | LONGBLOB |
| UNIQUEIDENTIFIER | CHAR(36) |
Example: SQL Server to MySQL 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 );
MySQL
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;Schemas do not survive, because MySQL does not have them
In SQL Server, dbo.orders and archive.orders are two tables in one database. In MySQL, a database is the namespace — there is no second level. Both tables want to be called orders, and one of them has to change.
There are two honest options. Flatten with a prefix, so archive.orders becomes archive_orders, which keeps everything in one database and breaks every query that referenced the schema. Or map each SQL Server schema to its own MySQL database, which preserves the two-part name but means cross-schema joins become cross-database joins, and a single transaction spanning them behaves differently.
Pick before converting. This decision propagates into every stored query, every ORM mapping and every report, and reversing it later is a second migration.
InnoDB's index key limit will reject indexes SQL Server allowed
InnoDB caps an index key at 3072 bytes. Under utf8mb4, MySQL reserves four bytes per character, so an index on a VARCHAR(1000) is computed as 4000 bytes and refused with error 1071 — even though no actual row is near that. SQL Server's 1700-byte limit on a nonclustered key is measured differently and lets the same column through.
The practical effect is that wide text indexes, and composite indexes over several medium text columns, do not convert one-to-one. A prefix index on the first N characters usually restores the lookup performance, but it is a different index with different uniqueness properties, so a unique constraint cannot be prefixed away without changing what the database enforces.
Datetime precision and the IDENTITY column
DATETIME2(7) carries 100-nanosecond precision. MySQL's DATETIME tops out at six fractional digits, so the seventh is dropped. That is usually irrelevant and occasionally not: if timestamps are used as a tiebreaker or an ordering key, two rows that were distinct in SQL Server can become equal in MySQL.
IDENTITY becomes AUTO_INCREMENT, with one structural constraint that catches people out — MySQL permits exactly one AUTO_INCREMENT column per table and it must be indexed. A SQL Server table with an IDENTITY column that is not part of the primary key needs that index adding. After the load, the counter has to be reseeded above the highest imported value, or the first production insert collides.
SQL Server → MySQL 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.
- AUTO_INCREMENT counters are reseeded to MAX(id)+1 after bulk load, so the first production insert doesn't collide.
- Oversized VARCHAR definitions from other engines are rewritten to TEXT/LONGTEXT to respect MySQL's row-size limits.
- Foreign keys are applied after data load with FOREIGN_KEY_CHECKS deferred for speed and ordering safety.
Frequently asked questions
Is SQL Server to MySQL migration production-ready in DBShifts?
Yes. SQL Server to MySQL is a certified pair: it passes the live certification suite on real SQL Server and MySQL servers, which checks schema fidelity, row counts, type-aware checksums and paging across batches.
What happens to SQL Server types that MySQL doesn't have?
Each gets the nearest MySQL 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 MySQL 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 MySQL?
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
How We Live-Certified All 49 Migration Paths
The certification harness behind this page's claims.
The Hidden Data-Loss Traps in Cross-Engine Migration
Five silent bugs the certification harness caught, from clipped TINYINTs to rounded NUMERICs.
Reference
Compared with other tools
Errors you may hit
Ready to move SQL Server to MySQL?
Set up in under two minutes. Validation and rollback included.
Start Free Migration