Microsoft SQL Server to MariaDB Migration

SQLines provides open source tools to help you transfer data, convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from Microsoft SQL Server to MariaDB.

We also help convert embedded SQL statements in C/C++ (ODBC, ESQL/C, DBLIB), C#, Java, PowerBuilder, VB/VB.NET, ASP/ASP.NET, Python, Perl/PHP and other applications.

  • Microsoft SQL Server 2016, 2014, 2012, 2008, 2005 and 2000
  • MariaDB 10.x and 5.x

SQL Server to MariaDB Migration Tools

SQLines SQL Converter Tool

SQLines SQL Converter tool allows you to convert database schema (DDL), queries and DML statements, views, stored procedures, functions and triggers from Microsoft SQL Server to MariaDB.

SQLines tool converts SQL scripts and standalone SQL statements. To migrate data and database schema from an SQL Server database use SQLines Data tool.

Try SQLines Online or download the Desktop Version.

SQLines Data Tool

SQLines Data is a scalable, high performance data transfer, schema conversion and validation tool for SQL Server to MariaDB migration.

For more information, see SQLines Data Tool.

SQL Server to MariaDB Migration Reference

Technical information on migration from Microsoft SQL Server to MariaDB.

Data Types

Converting data types from SQL Server to MariaDB:

SQL Server MariaDB
1 SMALLDATETIME Datetime (year, month, day, hour, minutes and 00 seconds ) DATETIME

Built-in SQL Functions

Converting functions from SQL Server to MariaDB:

SQL Server MariaDB
1 CONVERT(DATETIME, string, style) Convert string to datetime STR_TO_DATE(string, format)
2 CONVERT(VARCHAR, datetime, style) Convert datetime to string DATE_FORMAT(datetime, format)
3 DATEADD(unit, value, exp) Add datetime interval TIMESTAMPADD(unit, value, exp)
4 GETDATE() Get the current date and time NOW()

Transact-SQL Statements

Converting Transact-SQL statements from SQL Server to MariaDB:

Variable declaration and assignment:

SQL Server MariaDB
1 DECLARE @var [AS] type [= default_value] DECLARE var type [DEFAULT default_value]
2 DECLARE @v1 type1, @v2 type2, … DECLARE v1 type1; DECLARE v2 type2, DECLARE …
4 SET @var = expression SET var = expression
5 SET @var = (SELECT expression FROM …) SET var = (SELECT expression FROM …)

Flow-of-control statements:

SQL Server MariaDB
1 IF condition BEGIN … END IF statement IF condition THEN … END IF;
2 IF … ELSE IF … IF ELSE IF statement IF … ELSEIF …
3 WHILE condition BEGIN stmts END Conditional loop WHILE condition DO stmts END WHILE;