At the start of March last year, I posted about a site you can use to format SQL by pasting it in or uploading a file. That site is still present and working, but I’ve found a new website which formats SQL more to my liking (thinking specifically of formatting some of the Microsoft Dynamics GP stored procedures).
The SQL in the above is from my SQL View to Return Budgets by Month post.
Using the options to the right, you can change how the SQL is formatted, so you can alter how the SQL is formatted to make it closer to your required output.
I prefer a web based solution as I sometimes need to format SQL when I’m working on a client system and don’t have access to my own laptop, so one of the tools which can install into SQL Server Management Studio aren’t always usable.