SQLines tools can help you transfer data, convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from Microsoft SQL Server (MSSQL, MS SQL), Azure SQL Database, Azure Synapse to IBM DB2:
Databases:
Converting data types:
SQL Server | IBM DB2 | |
CHAR | Fixed-length character string | CHAR |
INT, INTEGER | 32-bit integer | INT, INTEGER |
SMALLINT | 16-bit integer | SMALLINT |
VARCHAR | Variable-length character string | VARCHAR |
Converting Transact-SQL user-defined functions:
SQL Server | IBM DB2 | |
1 | CREATE FUNCTION | ALTER FUNCTION name | CREATE OR REPLACE FUNCTION name |
2 | @param [AS] datatype = default | p_param datatype DEFAULT default |
3 | RETURNS datatype(len) | RETURNS datatype(len) |
4 | Optional AS before the function body | Removed |
5 | Optional statement delimiter | ; is added after each statement |
For more information, see Conversion of Transact-SQL Statements.
Converting Transact-SQL stored procedures:
SQL Server | IBM DB2 | |
1 | CREATE PROCEDURE name | CREATE OR REPLACE PROCEDURE name |
2 | @param [AS] datatype = default | p_param datatype DEFAULT default |
3 | Optional AS before the procedure body | Removed |
4 | Optional statement delimiter | ; is added after each statement |
For more information, see Conversion of Transact-SQL Statements.
Variable declaration and assignment:
SQL Server | IBM DB2 | |
1 | DECLARE @v1 type1, @v2 type2, … | DECLARE v1 type1; DECLARE v2 type2, DECLARE … |