Skip to content

Customizable Formatting ​

Choose your formatter engine and configure options to match your team's style guide.

Formatter engines ​

StyleSQL supports multiple T-SQL formatters, each with its own strengths and weaknesses:

ScriptDom (Microsoft) ​

  • Strengths: Microsoft's official SQL parser and generator; understands SQL Server version‑specific syntax differences; highly configurable (35+ options).
  • Weaknesses: picky about invalid/partial SQL; heavier than others on large scripts.

Poor Man's T-SQL Formatter (PoorSQL) ​

  • Strengths: popular, with opinionated defaults; moderate number of options.
  • Weaknesses: slower than ScriptDom and sql‑formatter; somewhat outdated.
  • Setup: Download from poorsql.org and extract SqlFormatter.exe to either:
    • The StyleSQL program files directory
    • %LocalAppData%\StyleSql\

sql-formatter (port of Prettier SQL / SQL Formatter VSCode plugin) ​

  • Strengths: lightweight and fast.
  • Weaknesses: fewer SQL Server‑specific options; limited configurability.

Configuration options ​

Common settings (all formatters) ​

  • Indentation — tabs vs spaces, indent size
  • Keyword casing — UPPERCASE, lowercase, or preserve
  • Blank lines between statements — control separation between statements

Options overview ​

  • ScriptDom (35+ options) — including:

    • SQL version auto-detect, initial QUOTED_IDENTIFIER
    • Include semicolons, keyword casing
    • New line before FROM/JOIN/WHERE/ORDER BY
    • Multiline SELECT elements and lists
  • PoorSQL (10+ options) — including:

    • Indentation style and width
    • Statement and clause breaks
    • Expand comma lists, uppercase keywords
  • sql-formatter (5+ options) — including:

    • Indentation style and width
    • Uppercase keywords
    • Max column length, lines between queries

How to configure ​

  1. Open StyleSQL settings (toolbar gear icon or Tools menu)
  2. Choose your formatter under "Formatter Options"
  3. Scroll through formatter options and tweak to your liking
  4. Click Save

Tips ​

  • Start with ScriptDom if you're working with modern SQL Server (2016+)
  • Use Auto SQL version detection (ScriptDom) to let StyleSQL pick the right version based on your server
  • Keep formatter settings in sync across your team by sharing the settings.json file

Where settings are stored ​

  • %AppData%/StyleSql/settings.json