Online SQL formatter overview

Applies to
Online SQL formatter

Summary
This article describes how SQL code can instantly be beautified using customizable options. The ApexSQL Online SQL formatter is formatting tool with over 200 formatting options.

The ApexSQL Online SQL formatter is the light version of ApexSQL Refactor, add-in for SQL Server Management Studio (SSMS) and Visual Studio.

With the ApexSQL Online SQL formatter, SQL scripts and SQL code can be formatted in the query editor.

Functional areas

The ApexSQL Online SQL formatter has three functional areas:

  • Main options bar
  • Options side bar
  • SQL code pane

Main options bar

All formatting options are grouped in the tabs and sub-tabs by category.

For example, all options related to capitalization rules are located under the Capitalization tab:

And all options related to formatting table columns are located under the Columns sub-tab:

To be familiar with all of the ApexSQL Online SQL formatter options, please visit the Formatting option mockups and examples page.

In addition, ApexSQL Online SQL formatter comes with four built-in formatting profiles.

These formatting profiles can be found in the profile drop-down list, and they are ApexSQL, Compact, Extended and MSDN SQL BOL.All built-in formatting profiles can be changed and customized:

  • ApexSQL – contains ApexSQL suggested SQL formatting standard
  • Compact – makes the SQL code more dense
  • Extended – expands the SQL code with additional spaces, tabs and empty lines
  • MSDN SQL BOL – mimics formatting settings used in MSDN resource site

Options side bar

Located on the left side of the ApexSQL Online SQL formatter page is the options side bar, and it shows all options for the chosen tab from the main options bar:

Additionally, the navigation section of the Online SQL formatter page will show on which tab a user is currently working on:

SQL code pane

The SQL code pane is where SQL can be added and formatted

SQL code pane

The SQL code pane contains three tabs for formatting SQL code

  • Input
  • Formatted
  • Sample

Tabs

Input

In the Input tab, a user can enter, paste, drag or upload SQL code to be formatted:

Formatted

The Formatted tab shows the formatted/processed version of the inputted SQL code:

Sample

The Sample tab contains hard-coded samples of SQL code to use while exploring options, to see the
impact, but before applying them to the desired SQL script:

/wp-content/uploads/2019/03/word-image-71.png

Features

Pane size

Additionally, the SQL code pane can be horizontally expanded, for easier reviewing, by pressing and holding the vertical pointer on the left side of the SQL code pane:

/wp-content/uploads/2019/03/word-image-72.png

By clicking the hamburger button on the left side of the Main options bar:

… the SQL code pane will expand to the whole page:

Uploading files

To upload a SQL script in the Online SQL formatter page, press the Choose file button:

From the Open window, choose either .sql or .txt file.

If an attempt is made to upload some other file format than
the .sql or .txt, the following message will appear:

/wp-content/uploads/2019/03/word-image-76.png

Quick tip:

The maximum allowed size of the upload file is 5MB

Reset

All changes made in the Options side bar can be returned to default vales by pressing
the Reset button:

/wp-content/uploads/2019/03/word-image-77.png

Quick tip:

The settings from the ApexSQL built-in formatting profile from the ApexSQL Refactor – add-in are used as SQL formatting default options values

Convert code to

The Convert code to drop-down box provides a simple way to convert a SQL code from the current active tab in the SQL code pane into client language-specific syntax – Java, VB.NET, C#, Perl, PHP, Delphi, Ruby, C++

/wp-content/uploads/2019/03/word-image-78.png

By clicking the icon in the top right corner, the About page will be shown with some additional information about Online SQL formatter:

FAQs

[Q] Can I define a custom rule for converting a SQL code rather than using those form the Convert code to drop down box?

[A] No, but this option is available in the ApexSQL Refactor add-in.

See more on the How to quickly convert SQL code to language-specific client code page

[Q] Can I create my own custom SQL formatting profile and use it in the Online SQL formatter page?

[A] No, but custom SQL formatting rules can be created in the ApexSQL Refactor add-in, see the How to customize SQL formatting profiles page

[Q] When I close the browser, will my options settings be preserved once I again open a browser?

[A] Yes, all formatting settings will be preserved in the browser cookies and stay there for the later usage, until its browser cache is cleared or the Reset button on the Online SQL formatter page is pressed

[Q] Can I upload and format more SQL files in the Online SQL formatter page at once?

[A] No, you can use the Format SQL scripts feature from ApexSQL Refactor add-in for that purpose.

See more in the Top things you need in a SQL formatter tool page

[Q] What browsers are supported?

[A] Internet Explorer 9 and above, Google Chrome, Mozilla Firefox, Microsoft Edge, Opera browsers