SQL translator › Oracle → T-SQL
Oracle to SQL Server translator
Oracle writes NVL and FROM DUAL. SQL Server writes ISNULL and omits the dummy table.
Usual swaps
| Oracle | SQL Server |
|---|---|
| NVL(a,b) | ISNULL(a, b) |
| NVL2(a,b,c) | CASE WHEN a IS NOT NULL THEN b ELSE c END |
| DECODE | CASE |
| SYSDATE | GETDATE() |
| FROM DUAL | (drop it) |
| ROWNUM <= n | TOP n |
| VARCHAR2 / NUMBER | nvarchar / decimal |
| || concat | CONCAT |
| TO_DATE / TO_CHAR | CONVERT / FORMAT |
| LISTAGG | STRING_AGG |
| MINUS | EXCEPT |
| CONNECT BY | recursive CTE |
ROWNUM before ORDER BY is not TOP after ORDER BY. Wrap, or use ROW_NUMBER.
Then write it on a ticket
Monday is free. A colleague asks, you type, we mark it.
Clock in free