views:

562

answers:

3

Folks, is there a tool to format/indent SQL Server queries in query window ?

TIA

+1  A: 

Format code in SQL Management Studio

Jack Marchetti
Not quite like the way i wanted but nevertheless useful.
SoftwareGeek
+3  A: 

+1 to JackM.

Just add a mention for some other (not free) tools available from Red Gate, depending on exact requirements.

SQL Prompt
SQL Refactor

Might be something you'd be interested in.

AdaTheDev
SQL Refactor -> Layout Sql seems more like it...
SoftwareGeek
A: 

SQL Enlight can do this.It works with SSMS and Visual Studio. There is also an online beautifier.

Ilian