T-SQL Beautifier is a free online utility that can validate, layout and colorize Transact-SQL code.
The tool is based on SQL Enlight's engine and offers a set of predefined layout templates that can be used to reformat code in different ways.
How to use the online T-SQL Beautifier
Example Transact-SQL scripts