SQL translator › T-SQL → PostgreSQL

SQL Server to PostgreSQL translator

Postgres wants LIMIT and ||. CONVERT(style) has no twin — use to_char.

Usual swaps

SQL ServerSQL Server
TOP nLIMIT n
ISNULLCOALESCE
GETDATE()now()
DATEADD(unit, n, d)d + interval
CONCAT / +|| or CONCAT
CONVERT(varchar, d, 23)to_char(d, 'YYYY-MM-DD')
STRING_AGGstring_agg
[brackets]"quotes" or lowercase
IDENTITYGENERATED … AS IDENTITY

BIT is boolean. nvarchar is text. OFFSET FETCH already looks like Postgres.

Then write it on a ticket

Monday is free. A colleague asks, you type, we mark it.

Clock in free