Skip to content
migration.tools
SQL Server to MySQL

SQL Server to MySQL converter

Convert SQL Server DDL and INSERT scripts to MySQL: brackets to backticks, IDENTITY to AUTO_INCREMENT, NVARCHAR to VARCHAR.

Going the other way? MySQL to SQL Server

Options

SQL Server SQL

MySQL 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 (SSMS → Tasks → Generate Scripts) 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 MySQL script and run it against a staging database first.

What changes between SQL Server and MySQL

[bracketed] identifiers become backticks and GO separators become semicolons. IDENTITY(1,1) becomes AUTO_INCREMENT.

BIT becomes TINYINT(1), NVARCHAR(n) becomes VARCHAR(n), NVARCHAR(MAX) becomes LONGTEXT, DATETIME2 becomes DATETIME, UNIQUEIDENTIFIER becomes CHAR(36) and VARBINARY(MAX) becomes LONGBLOB.

N'…' Unicode string prefixes are removed; tables are created as InnoDB with utf8mb4.

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 SQL Server's procedural language and need a human rewrite for MySQL.

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

Why were defaults removed from my text columns?

MySQL doesn't allow literal defaults on TEXT, BLOB or JSON columns. Each one is listed in the review notes.