We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this questionFolks, is there a tool to format/indent SQL Server queries in query window ?
With Apex SQL Refactor, you can specify your formatting preferences and reformat selected code or the entire window at any time using a keyboard shortcut. There's a free version.
+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.
Format code in SQL Management Studio
Older question which has much more activity and more answers: SQL Formatter for SQL Management Studio
My contributon to this mess is Poor Man's T-SQL Formatter / http://poorsql.com - free, open-source, does bulk formatting from command-line, SSMS plugin, etc, and (in theory) handles all SQL syntax up to SQL Server 2008 (R2).
精彩评论