Features

Handles "procedural" T-SQL; this is not just a SQL statement formatter, but it also
formats entire batches, and multi-batch scripts.

Optional colorized HTML output

Fault-tolerant parsing and formatting - if some unknown SQL construct is encountered
or a keyword is misinterpreted, parsing does not fail (but will simply not colorize
or indent that portion correctly). If the parsing fails more catastrophically, a
"best effort" will be made and warning displayed (or in the case of interactive
use, eg in SSMS, the operation can be aborted).

Works in Microsoft .Net framework, as well as Mono. The Winforms Demo App is not (yet?)
available in Mono, but the library itself is fully functional, as is the command-line
bulk formatting tool.

General Limitations

This is NOT a full SQL-parsing solution: only "coarse" parsing is performed, the
minimum necessary for re-formatting.

The standard formatter does not always maintain the order of comments in the code;
a comment inside an "INNER JOIN" compound keyword, like "inner/*test*/join", would
get moved out, to "INNER JOIN /*test*/". The original data is maintaned in the
parse tree, but the standard formatter shuffles comments in cases like this for
clarity.

DDL parsing, in particular, is VERY coarse - the bare minimum to display ordered table
column and procedure parameter declarations.

No effort has been made to support compatibility level 70 (SQL Server 7)

Where there is ambiguity between different compatibility levels (eg cross apply
parens in compatibility level 90 vs table hints without "WITH" keyword in
compatibility level 80), no approach has been decided. For now, table hints
without WITH are considered to be arguments to a function.

NDesk.Options, for command-line parsing: The NDesk.Options library is licensed under
the MIT/X11 license, and its homepage is here: http://www.ndesk.org/Options

LinqBridge, for convenience, supporting extension methods and Linq-to-Objects
despite this being a .Net 2.0 library. LinqBridge is licensed under the BSD 3-clause
license, and its homepage is here: http://code.google.com/p/linqbridge/

NUnit, for automated testing. NUnit is licensed under a custom open-source license
based on the zlib/libpng license, and its homepage is: http://www.nunit.org/