Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++/Eclipse sql code auto-indent option?

DDL gets especially ugly. Is there any option of SQL auto-indenting for Notepad++? I've tried to do it in Eclipse, but the code doesn't react to auto-indent.

like image 477
Aubergine Avatar asked Oct 24 '11 03:10

Aubergine


People also ask

How do I indent my SQL code?

To indent codeSelect the text you want to indent. Press TAB, or click the Indent button on the Standard toolbar.

How do I turn on auto indent in Notepad ++?

I type some code, select it and then use: menu TextFX → TextFX Edit → Reindent C++ code. TextFX should be installed by default.


2 Answers

Yes, there is a free/open-source T-SQL formatting plugin for Notepad++, called "Poor Man's T-SQL Formatter". It is available in the NPP "Plugin Manager" plugin list (gets updated every once in a while automatically), and is also available for manually downloading/installing from here: http://www.architectshack.com/PoorMansTSqlFormatter.ashx

If you just want to check it out without adding to notepad++, you can check the online formatting site:

http://poorsql.com

(disclaimer: I wrote these tools :))

like image 63
Tao Avatar answered Sep 26 '22 06:09

Tao


There is also another free SQL Formatter plugin for Notepad++ with code folding and coloring and 100+ formatting option here: SQLinForm Free Notepad++ Plug-n. A free version is also available.

enter image description here

like image 27
Guido Avatar answered Sep 24 '22 06:09

Guido