SQL formatter
Paste a query or a whole script: it is laid out clause by clause, with subqueries, CASE and procedure bodies indented. Fold blocks, comment them out and back in, add notes, and search.
Formatted
Paste SQL above and press Format: the result appears here, ready to fold, comment and search.