I regularly have to debug large MySQL queries from a logfile and am looking for a tool to format and indent them - preferably windows command line, but will consider anything.
A:
You could use vi/vim to indent sql qeuries. That's how I've been formatting them. However the drawback is that the query needs to be seperated into multiple lines for the indentation to be useful.
nan
2009-03-11 16:41:27
+1
A:
SQLinForm is a tool I came across which may serve your needs. There is a free online version or a desktop version for 30 EUR.
Here is the summary blurb from their website:
SQLinForm is an automatic SQL code formatter for all major databases ( ORACLE, SQL Server, DB2 / UDB, Sybase, Informix, PostgreSQL, Teradata, MySQL etc) with many formatting options.
Ben Hoffstein
2009-03-11 16:55:22