Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Free SQL Formatting Tools exist? [closed]

Tags:

sql

formatting

I want to beautify the SQL Queries I write.

What free tools exist that allow for SQL query formatting?

like image 989
grady Avatar asked Jul 22 '10 14:07

grady


People also ask

Does SSMS have a SQL Formatter?

SSMS provides a couple of options to format SQL code. Those options are indenting, tab sizing, make all code in upper or lower case, comment/uncomment selected code, etc.

How can I beautify code in SQL Server?

Format SQL Code in SSMS Query Window To use the SSMS add-in component we will have to close and then open SSMS after the install of the add-in. Then open a SSMS query window, highlight the code that needs to be formatted. Then select Format T-SQL Code from the SSMS Tools menu. Here is the code after the formatting.

How can I get beautify code in SSMS?

The SSMS Add-in allows you to set your own hotkey (default is Ctrl - K , Ctrl - F , to match Visual Studio), and formats the entire script or just the code you have selected/highlighted, if any. Output formatting is customizable.

How can I beautify SQL code in Notepad ++?

Format and Beautify your SQL Statements with ALT+F. You can switch-on the live formatting feature in the SQLinForm Options Dialog. While playing around with the options you can switch on the live preview feature to see immediately the impact of the new formatting style in your SQL.


2 Answers

PoorMansTSqlFormatter is a free and open-source online beautifier, with offline SSMS Add-In, command-line beautifier tool, and Notepad++ plugin.

The project aims to format any T-SQL (2000 or later) script, no matter the length or complexity.

Hope this helps!

like image 67
Tao Avatar answered Sep 30 '22 16:09

Tao


As of 10.02.2022 the site is not reachable anymore.

T-SQL Tidy (dead link: http://www.tsqltidy.com) is a very good online SQL formatter/beautifier.

It has a lot of formatting options. Although it's targeted to T-SQL, it should work with most SQL dialects.

like image 23
MicSim Avatar answered Sep 30 '22 16:09

MicSim