PostgreSQL to Microsoft SQL Server Migration

SQLines provides tools to help you convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from PostgreSQL (Postgres) to Microsoft SQL Server (MSSQL, MS SQL), Azure SQL and Azure Synapse.


  • PostgreSQL 15.x, 14.x, 13.x, 12.x, 11.x, 10.x and 9.x
  • Microsoft SQL Server 2022, 2019, 2017, 2016, 2014, 2012, 2008 and 2005

Migration Reference

Built-in SQL Functions

Converting datetime functions:

PostgreSQL SQL Server
1 TO_TIMESTAMP(string, format) Convert string to timestamp CONVERT(DATETIME, string, style)