SQLines tools can help you transfer data, convert database schema (DDL), views, stored procedures and functions, triggers, SQL queries and SQL scripts from MySQL to Microsoft SQL Server (MS SQL, MSSQL), Azure SQL and Azure Synapse.
Databases
Converting language elements and constructs:
MySQL | SQL Server | |||
1 | b'100' | Binary string | 0x04 | Hex string |
Converting identifiers:
MySQL | SQL Server | |
Quoted Identifiers | ` (backtick) and " (double quotes) | [ ] and " (double quotes) |
Converting numeric data types:
Converting other data types:
Data Type Attributes:
MySQL | SQL Server |
Display width for integers INT(d) | Not supported |
UNSIGNED | CHECK (col_name > 0) |
AUTO_INCREMENT | IDENTITY |
COLLATE collate_name | |
CHARACTER SET charset_name | |
COMMENT 'string' | |
ON UPDATE clause for TIMESTAMP columns | Not supported |
BINARY(0) | BINARY(1) |
Converting functions:
MySQL | SQL Server | |||
1 | CURRENT_TIMESTAMP | CURRENT_TIMESTAMP() | Get current date and time | GETDATE() |
Converting table definitions:
MySQL | SQL Server | |||
1 | UNIQUE KEY | INDEX name (column, …) | CONSTRAINT name UNIQUE (column, …) | ||
2 | KEY name (column, …) | Inline non-unique index | CREATE INDEX name ON table(column, …) | Standalone statement |
Converting SQL queries:
MySQL | SQL Server | ||
1 | SELECT … FROM … LIMIT n | Select n rows only | SELECT TOP n … FROM … |
Converting stored procedures:
MySQL | SQL Server | ||
1 | CREATE PROCEDURE name | CREATE PROCEDURE name | |
2 | DEFINER = user | Removed | |
3 | IN | OUT | INOUT param datatype(len) | Parameter definition | @param datatype(len) OUT | OUTPUT |
4 | No AS keyword before outer BEGIN END block | AS keyword required | |
5 | User-defined delimiter at the end | GO |