I’m looking for a script or application that tidies up and reformats SQL queries. I’ve found some good online SQL formatters (see here) , as well as some downloadable commercial applications. I’m cautious about using an online service as I don’t want to risk copies of these queries being stored somewhere they might be compromised, if only in a web server’s cache (and it is against my employer’s policy).
Does anyone know of any open-source applications, scripts, or downloadable freeware that might help me out with this?
It probably bears mentioning that I’m working on a Windows platform at work, but I am open to suggestions for other operating systems.
Cheers!
Update
I have used SQLInform as suggested by Vinko Vrsalovic to excellent effect. Thanks Vinko!
Something that might also be worth watching is SQLTidy, a young project on Google Code which could turn into something great in the long run.
Some things to try out (SQLinForm is free until 2009). It’s weird how some niches totally lack good open source tools.
http://www.trialpay.com/checkout/?c=bb7014d&tid=6rGUpGo
http://www.sqlinform.com
http://www.fileheap.com/software-universal-sql-editor-download-11096.html
An Emacs macro:
http://www.emacswiki.org/emacs-en/tsql-indent.el