Put your mangled SQL in the box below, then tab or click outside the box (don't forget to play with the options on the right!)
Please note, as you're running locally, using "Ctrl-a" to select the formatted output will not work (you'll get the whole page). Instead, you can click here to select the formatted content.
PoorSQL.com is an online SQL formatting service that uses the
Poor Man's T-SQL Formatter library.
This is an open-source (AGPL-licensed)
C#/.Net 2.0 library, and the library, plugins and source are all available for download on the
project page. The
source code is hosted on GitHub, and
any feedback, enhancements, and feature requests would be much appreciated!
As the page uses a .Net library, it does send the SQL you provide to a server (currently hosted
somewhere in the US by WinHost.com). If you would prefer to avoid transmitting your SQL across the
network, please download and use one of the offline options - it's all free and open-source anyway.
To keep track of updates / changes, follow @PoorSQL on Twitter.
Some usage tips:
- You can specify the SQL to be formatted in the querystring, with an "inputString" parameter.
- If your provided SQL is quite small, we'll automatically provide a link on the formatted result tab, in case you want to share a query.
- We try to remember your formatting options/settings with a cookie. If you're blocking cookies, you'll just have the default options every time you visit.
- In standard formatting, you can identify a block of SQL which should NOT be changed - just surround it with [noformat][/noformat] tags in comments.
- In standard formatting, you can identify a block of SQL which should be minified - just surround it with [minify][/minify] tags in comments.
- The formatting library now in its "first official release", but you may find previously-unknown issues. If you see something ugly (or, worse, an error!), please contact me (email at the bottom of the page) or log an issue in the issue tracker on GitHub.