Beautify TSQL code in (or out of) Query Analyzer?

  • I'm looking for some way to beautify my (and others) TSQL code.  I was always able to do this in Visual FoxPro, and just wondering if anyone has any recommendations.

    I'm looking for:

    • Auto Indenting
    • Auto keyword capitalization
    • Auto variable ProperCase capitalization
    • Cheap
    • Better yet, free!

    That's about it...not too much to ask, I think.  I've tried using UltraEdit, which I own, but I can't get it to work very well. 

    Any hints, suggestions...anyone?

  • Take a look at SQL IDE by Imceda Software.

    http://www.imceda.com/Product.htm

    There is a Lite and Pro version.

    Regards

    Douglas

  • Douglas - Thanks for the reply!

    However, SQL IDE seems to be a repackaged version of sqlXpressIDE (Client & Server), which is way more than I need.  I just need something to clean up the code.  There would be no way for me to convince my DBA to allow installation of a server database just for this task.

    Can you think of any others?

  • This would accomplish part (not all) of your goal...but it's free. In Enterprise Manager, open a table in your database in a grid (Open Table -> Return all rows), then click the SQL button (Show/Hide SQL Pane) on the toolbar. Paste the SQL code you want in there, and then click the run (!) button (or press Ctrl + R), and you will notice that the SQL you pasted has been prettied up some, including capitalizations, provided there were no syntax errors.

  • Wow!  I was super-excited when I put in a simple statment, and it did just as you said!

    However, I then put in a whole (complicated) procedure, and tried it, it performed the auto capitalization correctly, but merged many lines into one, and put indenting in all sorts of weird places.

    I did find one app (http://www.netbula.com/products/sqlb/) that makes an attempt, but not very well.  Anyone know how to do it with UltraEdit?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply