David Beroff (d4b) wrote in databases,
David Beroff
d4b
databases

SQL Prettification?

phpMyAdmin parses and prettifies complex SQL with formatting and color (e.g., right). I cannot seem to copy-and-paste this to a rich-text document, e.g., GMail, GDocs, etc. (Yes, I tried looking at the HTML source.) Ideally, I'd like to have the general case, where I can select a portion of any arbitrary webpage and copy/paste the formatted data (which does work 95% of the time). But for the moment, does anyone here know of a SQL prettifier, ideally online, that will allow me to just copy/paste?

I'm using Firefox 2.0.0.6 and the current versions of Google Docs and GMail.

Thanks!

(Cross-posted to databases, d4b.)
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 4 comments
I really think people's taste in SQL formatting varies too widely for automated formatting tools. For instance, you say that image is the output of a prettifier, but I couldn't begin to read it without reformatting it myself.
No argument that the output from phpMyAdmin could be improved, but it's still better than nothing. I'm happy to accept someone else's taste if it means that I don't have to prettify these queries by hand.
I sometimes use SQLinForm. There's also SQLpp available.

I generally find these sort of tools very handy whenever I receive a SQL statement that has been generated by some third party tool with no line breaks at all. It's never exactly the way I would write my own SQL, but that's not really what's important in that use case.
Excellent; thank you very much!!