Beautify SQL

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
elcaro
Posts: 7
Joined: Fri May 25, 2012 9:38 pm

Beautify SQL

Post by elcaro »

Hi,

Let me start with praising Textpad! I use this so extensively and for everything (most of the work). I wish it had code/sql beautifier.

Is there any add-on or external utility that I can use with Textpad to beautify the selected sql code/query?

I found some online options like this which I use to launch it from Textpad using External Tools. In this case I copy my sql and paste it here and copy-and-paste it back in Textpad.
http://www.dpriver.com/pp/sqlformat.htm

I also found a command line tool at http://poorsql.com/ but I don't know how to call it from Textpad to format the sql and bring the results back in Textpad. Even if somebody can help me get the results into clipboard, that would be of great help too.

Thanks.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

If you can manage to find a command-line utility that outputs the SQL code to standard output, you can pipe the output to the clip command that comes with Windows Vista and later.

However, I tried the Poor SQL tool you mentioned and could not get it to work with TextPad at all. Whenever I tried to invoke it as an external tool, SqlFormatter.exe would crash with a "System.IO.IOException: The handle is invalid" exception.
Post Reply