Montag, 14. April 2008

Source beautifier for SQL statements

A lot of developers uses source code beautifier tools for their source code, e.g. our ObjectPascal. But I found a nice online-tool for SQL-statements. You can not only format the SQL-command for the Database-server (Oracle, MSSQL and other) like the following result:
SELECT HHJ,
CUSTOMER,
ORDER_ID
FROM TABLE

On the right side you have some options for formatting.

You can format this SQL-Statement for Delphi .....

var1 := 'SELECT HHJ,' ;
var1 := var1 + ' CUSTOMER,' ;
var1 := var1 + ' ORDER_ID' ;
var1 := var1 + ' FROM TABLE' ;

And other languages... e.g. for C# you can choose between
String var1 = "SELECT HHJ," ;
var1 = var1 + " CUSTOMER," ;
var1 = var1 + " ORDER_ID" ;
var1 = var1 + " FROM TABLE" ;
and
StringBuilder var1 = new StringBuilder("SELECT HHJ,");
var1.Append(" CUSTOMER,");
var1.Append(" ORDER_ID");
var1.Append(" FROM TABLE");


I found this very usefull for formatting my SQL-statement to read it sometimes later better..

Here you'll find the Online SQL and PL/SQL Formatter

12 Kommentare:

  1. Very nice! I've being looking for something like this for a long time. Thank you.

    AntwortenLöschen
  2. Here is the latest version for this free online sql formatter:
    http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm

    AntwortenLöschen
  3. thanks for the update-url! :-) thomas

    AntwortenLöschen
  4. HI,
    here is another free online SQL Formatter. http://www.sqlinform.com

    Regards
    GuidoMarcel

    AntwortenLöschen
  5. Thx. I've being looking for something like this for a long time.
    God place you.
    My Blog ;)

    AntwortenLöschen
  6. Thx. I've being looking for something like this for a long time.
    God place you.
    My Blog ;)

    AntwortenLöschen
  7. Thx. I've being looking for something like this for a long time.
    God place you.
    My Blog ;)

    AntwortenLöschen
  8. Thanks for sharing this link, but unfortunately it seems to be offline... Does anybody have a mirror or another source? Please reply to my post if you do!

    I would appreciate if a staff member here at rave-notes.blogspot.com could post it.

    Thanks,
    Alex

    AntwortenLöschen
  9. Hi,

    http://www.dpriver.com/pp/sqlformat.htm
    is another (working / available ...) formatter for SQL.

    :-) htomas

    AntwortenLöschen
  10. Hello there,

    Thanks for sharing this link - but unfortunately it seems to be down? Does anybody here at rave-notes.blogspot.com have a mirror or another source?


    Thanks,
    Thomas

    AntwortenLöschen
  11. Hi,

    Thanks for sharing this link - but unfortunately it seems to be down? Does anybody here at rave-notes.blogspot.com have a mirror or another source?


    Cheers,
    William

    AntwortenLöschen
  12. Hello there,

    I have a message for the webmaster/admin here at rave-notes.blogspot.com.

    Can I use part of the information from your blog post above if I provide a backlink back to your site?

    Thanks,
    John

    AntwortenLöschen