Following link helps you format and beautify SQL Code: http://sqlserverlearner.com/online-tools/tsql-code-formatter
Learn SQL Server Online
Following link helps you format and beautify SQL Code: http://sqlserverlearner.com/online-tools/tsql-code-formatter