Skip to content
benlaan edited this page Apr 21, 2013 · 2 revisions

SQL Parser in C#, using .NET 3.5.

The intention of this project is to implement a 'pretty formatter' of SQL because of the terse nature of NHibernate generated SQL, and also to ensure SQL is readable (according to my standard).

There is also a simple one page sql formatter available here to allow some experimentation, but this project is still in its infancy, so don't expect too much just yet!

Current Features

  • Supports SELECT, INSERT, UPDATE, DELETE, DECLARE, GO statements
  • Uses white space liberally to separate table and join parts
  • MSI for an addin into MS Management Studio 2008 to allow formatting and template expansion
  • NHibernate Appender to asynchronously format all NHibernate.SQL originated log messages
  • Simple web page to allow adhoc SQL formatting
  • Can convert sp_executesql including variable declarations

Plans for future updates

  • Fix all reported bugs
  • Implement more formatting output for INSERT statement
  • Implement formatter for CREATE TABLE, ALTER TABLE, CREATE INDEX, etc.
  • Implement CREATE/ALTER PROCEDURE