It is annoying to see improperly formatted lengthy SQL code. For C# Visual Studio does the job neatly. For SQL I was looking for some plug-in or Tool which can format SQL code. The long search come to end with an online tool.
Check out here http://www.dpriver.com/pp/sqlformat.htm