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 and JS 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!
This page now uses pure client-side JS, and combined with AppCache functionality this means that:
- This site does not send the SQL code you provide formatting to any external service - all formatting is done within your browser
- This site does not require an internet connection - it will keep working equally well when you are offline
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 has been around for a while, but you may still 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.