Rewrite SQL Server proprietary joins to ANSI SQL compliant joins

This demo illustrates how to rewrite SQL Server proprietary joins to ANSI SQL compliant joins, it’s a very useful tool if you have lots of old SQL Server propriety joins that need to be converted to ANSI SQL compliant joins. You can also learn how to rewrite SQL to meet your own requirement from this demo.

SQL Server propriety joins

SELECT t1.*
FROM   table1 t1,
       table2 t2
WHERE  t1.f1 *= t2.f1
       AND t1.f2 > 10 

Convert to ANSI SQL compliant joins

SELECT t1.*
FROM   table1 t1
       LEFT JOIN table2 t2
         ON t1.f1 = t2.f1
WHERE  t1.f2 > 10 

Download this demo: C# version

Reference:

1. sybase: Converting outer joins with join-order dependency