Move schemas and data from a MySQL database to Microsoft SQL Server quickly and safely.
You must convert schema, translate data types, move the data itself, and rewrite application queries that use MySQL-specific syntax.
Use Microsoft SQL Server Migration Assistant (SSMA), the Data Migration Assistant (DMA), or command-line exports paired with BULK INSERT or bcp.
SSMA excels when you need automatic schema conversion, data copy, and post-migration validation in one wizard-driven workflow.
For small databases or one-time moves, exporting to CSV with mysqldump --tab
and loading via BULK INSERT
can finish in minutes.
Disable foreign keys and triggers, set SET FOREIGN_KEY_CHECKS = 0
, then capture DDL with mysqldump --no-data
so SSMA can parse clean definitions.
SSMA maps MySQL INT
to INT
, TINYINT(1)
to BIT
, DATETIME
to DATETIME2
, and TEXT
to NVARCHAR(MAX)
. Review mappings and override when storage or precision matters.
In SSMA, click “Migrate Data.” For manual moves, export each table:mysqldump -T /tmp/ecom --fields-terminated-by="," ecommerce_db Products
Then load into SQL Server:BULK INSERT dbo.Products FROM '/tmp/ecom/Products.txt' WITH (FIELDTERMINATOR=',', ROWTERMINATOR='\n')
Run counts and checksums:SELECT COUNT(*) FROM mysql_db.Products
vs.SELECT COUNT(*) FROM sqlsrv_db.dbo.Products
. For deeper checks, compare CHECKSUM_AGG
on key columns.
Create clustered indexes, rebuild statistics, and enable READ_COMMITTED_SNAPSHOT
for row-versioning concurrency similar to MySQL’s default.
Replicate ongoing MySQL changes into SQL Server using Azure DMS or custom CDC scripts, run a final sync, switch application connection strings, and monitor error logs.
Yes, Microsoft distributes SQL Server Migration Assistant at no cost.
SSMA converts many routine constructs, but complex MySQL-specific syntax (e.g., LIMIT offset
) may need manual editing.
SSMA maps ENUM to NVARCHAR. Create CHECK constraints in SQL Server to enforce allowed values post-migration.