Online SQL Formatter
With the online SQL Formatter you can easily format your SQL’s to a nice format.
Before
SELECT D.Dept_Name, AVG(Getdate()-DOB) FROM EMPLOYEE E
/*Comment now comes an inner join*/ INNER JOIN DEPARTMENT D ON
E.DEPT_ID=DEPT_ID GROUP BY DEPT_ID;
After
SELECT D.Dept_Name,
AVG(Getdate()-DOB)
FROM EMPLOYEE E
/*Comment now comes an inner join */
INNER JOIN DEPARTMENT D
ON E.DEPT_ID=DEPT_ID
GROUP BY DEPT_ID;
You can also download the desktop version which requires JRE 1.5.
Update:
Another SQL and PL/SQL Formatter.