Well it’s really pity that neither VS2010 nor SQL development studio provide SQL syntax formatter. but anyway there good news is that there are sites like http://www.tsqltidy.com out there which would this for you for free.
but that was not enough for me. i wanted to have tool with me to do this even when i am not connected to the internet–although does not happen that often -
Since i use Notepad++ as my text editor, i tought there might be a plug in for it. so searching online i found T-SQL formatter plug in.
it’s not still a perfect formatter but in almost 90% of the times it’s done a great job for me.
so if you also need a SQL formatter you may want to try this.
To install it, open Notepad++, click on Plugins Menu and from the Plugin Manager menu click on Mange Plugins sub menu.
then from the Plugin Manager dialog box, select Poor Man’s T_Sql Formatter can click on install
it will ask you to restart the application click yes and next time you run Notepad++ you’ll have good SQL formatter plugin installed:
Jan
16 Mar 12 at 6:00 PM