Skip to content
migration.tools
MySQL to SQL Server

MySQL to SQL Server converter

Convert a MySQL dump to T-SQL for SQL Server or Azure SQL: backticks to brackets, AUTO_INCREMENT to IDENTITY, and Unicode-safe NVARCHAR columns.

Going the other way? SQL Server to MySQL

Options

MySQL SQL

SQL Server SQL

The result appears here as soon as there is input.

Processed on this device. Nothing you paste or drop is uploaded.

How to use it

  1. 1Export your database (mysqldump or phpMyAdmin) and paste the SQL, or drop the .sql file.
  2. 2Read the review notes under the output — they list everything that needs a human decision.
  3. 3Download the SQL Server script and run it against a staging database first.

What changes between MySQL and SQL Server

AUTO_INCREMENT becomes IDENTITY(1,1), and INSERTs into those tables are wrapped in SET IDENTITY_INSERT … ON/OFF so your original ids are preserved.

VARCHAR becomes NVARCHAR, TEXT and JSON become NVARCHAR(MAX), TINYINT(1) becomes BIT, DATETIME becomes DATETIME2 and BLOBs become VARBINARY(MAX).

Multi-row INSERTs are split into batches of 1,000 rows, SQL Server's limit, and LIMIT n in queries becomes TOP (n).

What to check before you run it

Run the converted script against an empty staging database first, inside a transaction if the target supports transactional DDL. The review notes under the output list every statement that was dropped, every type with no direct equivalent and every clause that needs a manual decision.

Views, triggers, stored procedures and functions are passed through unchanged and flagged. Their bodies are written in MySQL's procedural language and need a human rewrite for SQL Server.

After loading, compare row counts table by table. For a deeper check, export a table from both databases and run the two files through the CSV compare tool.

Questions

Does this work for Azure SQL Database?

Yes. The output is plain T-SQL with no file-group or server-level options, so it runs on SQL Server 2016+ and Azure SQL.