SQLFormatter
FormatterConvertPricingDocsGet Pro
SQL Converter · PostgreSQLT-SQL

Convert PostgreSQL SQL to T-SQL

PostgreSQL to SQL Server swaps LIMIT for TOP, "double quotes" for [brackets], ILIKE for LIKE and now() for GETDATE(). A mechanical formatter only re-indents — it won’t rewrite dialect-specific syntax. The AI converter in the app translates the query and the table below shows exactly what changes.

PostgreSQL — source
PostgreSQL
SELECT p.id, p.title
FROM posts p
WHERE p.title ILIKE '%sql%'
  AND p.published_at > now() - INTERVAL '1 month'
ORDER BY p.published_at DESC
LIMIT 50;
T-SQL — converted
T-SQL
SELECT TOP 50 p.id, p.title
FROM posts p
WHERE p.title LIKE '%sql%'
  AND p.published_at > DATEADD(MONTH, -1, GETDATE())
ORDER BY p.published_at DESC;
Convert your own query

What changes from PostgreSQL to T-SQL

PostgreSQLT-SQLWhy
LIMIT 50SELECT TOP 50Postgres LIMIT becomes a leading TOP clause.
ILIKELIKET-SQL LIKE is case-insensitive by collation; there is no ILIKE.
now() - INTERVAL '1 month'DATEADD(MONTH, -1, GETDATE())Interval math becomes DATEADD.

Other SQL conversions

PostgreSQLMySQLMySQLT-SQLPostgreSQLRedshiftPostgreSQLBigQueryPostgreSQLSnowflakeAll conversions →