An important aspect of writing code is formatting. No one likes badly formatted code. It’s hard to understand/maintain for people inheriting it and even for the author, when he/she checks it after week or so
I do understand that developers work under strict delivery guidelines and no one would want to delay the delivery on expense of formatting the code, making it nice and beautiful. However, with free T-SQL formatters it hardly takes time and one gets a clean formatted code without delaying the release. Here is list of T-SQL code formatters.
- Poor Man’s T-SQL formatter
It’s Open source T-SQL formatter. It is available both online – www.poorsql.com and as SSMS plugin http://architectshack.com/PoorMansTSqlFormatter.ashx#Download_5
- TSQL Tidy
- Instant SQL Formatter
The free online tool is available here http://www.dpriver.com/pp/sqlformat.htm
- SQL Format
The free online tool is available here http://sqlformat.org
- ApexSQL Refactor
The free tool is available here – http://www.apexsql.com/sql_tools_refactor.aspx
The online free tool is available here http://www.sql-format.com/
- Dbforge SQL Complete
It is a paid tool and is available here http://www.devart.com/dbforge/sql/sqlcomplete/.
- The simple talk code prettifier
The free online tool is available here http://extras.sqlservercentral.com/prettifier/prettifier.aspx
- RedGate SQL Prompt
Paid tool available here http://www.red-gate.com/products/sql-development/sql-prompt/
10. SSMS tools pack
It is available here http://www.ssmstoolspack.com/
Make use of the free tools and write a clean formatted code. Do add to the list if you know of any other formatting tool.