SQL Formatter Options

CASE

A CASE expression is a decision table written inline, and it benefits more than any other construct from consistent formatting: with each WHEN on its own line, the branches can be compared vertically. These options cover the CASE, WHEN, THEN, ELSE and END keywords, the conditions inside a WHEN, and a threshold that keeps very short CASE expressions on one line.

CASE Keywords

These options place the five keywords that make up a CASE expression. Read them as pairs: Linebreak Before decides whether the keyword starts a new line, Linebreak After whether its operand starts a new line.

CASE / END
IDOptionWhat it doesDefault
ID026ProLinebreak Before CASE Keyword
LBB_CASE
Puts CASE on a new line. In a SELECT list this separates the CASE expression from the column before it.on
ID042ProLinebreak After CASE Keyword
LBA_CASE
Starts the first WHEN on the line after the CASE keyword.on
ID044ProLinebreak Before END Keyword
LBB_CASE_END
Puts END on a new line, where it closes the expression at the same indentation as CASE.on
ID121ProIndent CASE Statement inside brackets
IND_CASEBRACKET
Indents a CASE expression that sits inside brackets, for example within a function call.off
ID026 off, ID042 off, ID044 off
select emp_name, case when salary > 5000 then 'high' else 'low' end as band
from   employee
ID026 on, ID042 on, ID044 on
select emp_name,
       case
           when salary > 5000 then 'high'
           else 'low'
       end as band
from   employee
WHEN
IDOptionWhat it doesDefault
ID055ProLinebreak Before WHEN Keyword
LBB_CASE_WHEN
Puts each WHEN on a new line. This is the option that turns a CASE expression into a readable decision table.on
ID043ProLinebreak After WHEN Keyword
LBA_CASE_WHEN
Starts the condition on the line after the WHEN keyword.on
ID048ProIndent WHEN Conditions
IND_CASE_WHEN
Indents the WHEN conditions one level deeper than CASE, subordinating the branches to the expression.on

This is the option that turns a CASE expression into a readable decision table: one branch per line, comparable top to bottom.

ID055 off
case when salary > 5000 then 'high' when salary > 2000 then 'mid' else 'low' end
ID055 on, ID048 on
case
    when salary > 5000 then 'high'
    when salary > 2000 then 'mid'
    else 'low'
end
THEN
IDOptionWhat it doesDefault
ID052ProLinebreak Before THEN Keyword
LBB_CASE_THEN
Puts THEN on a new line, separating each condition from its result.on
ID046ProLinebreak After THEN Keyword
LBA_CASE_THEN
Starts the result value on the line after THEN.off
ID085ProIndent THEN Keyword
IND_CASE_THEN
Indents THEN one level deeper than its WHEN.off
ID052 off
case
    when salary > 5000 then 'high'
    when salary > 2000 then 'mid'
end
ID052 on
case
    when salary > 5000
    then 'high'
    when salary > 2000
    then 'mid'
end

Tip: Add ID085 to indent the THEN line one level below its WHEN, which keeps the condition and its result visually paired.

ELSE
IDOptionWhat it doesDefault
ID053ProLinebreak Before ELSE Keyword
LBB_CASE_ELSE
Puts ELSE on a new line, aligned with the WHEN branches.on
ID047ProLinebreak After ELSE Keyword
LBA_CASE_ELSE
Starts the default value on the line after ELSE.off
ID086ProIndent ELSE Keyword
IND_CASE_ELSE
Indents ELSE one level deeper.off
ID053 off
case
    when salary > 5000 then 'high' else 'low'
end
ID053 on
case
    when salary > 5000 then 'high'
    else 'low'
end

CASE Conditions

Applies to the boolean expression inside a WHEN, not to the CASE expression as a whole.

Brackets
IDOptionWhat it doesDefault
ID117ProLinebreak Before '('
LBB_OPENCASEBRACKET
Puts the opening bracket of a WHEN condition on a new line.off
ID118ProLinebreak After '('
LBA_OPENCASEBRACKET
Starts the condition on the line after the opening bracket.on
ID119ProLinebreak Before ')'
LBB_CLOSECASEBRACKET
Puts the closing bracket on a new line.off
ID120ProLinebreak After ')'
LBA_CLOSECASEBRACKET
Starts whatever follows on the line after the closing bracket.off
ID118 off
when (salary > 5000 and job = 'MGR') then 'senior'
ID118 on
when (
         salary > 5000
         and job = 'MGR'
     ) then 'senior'
AND/OR
IDOptionWhat it doesDefault
ID056ProLinebreak Before AND/OR
LBB_CASE_ANDOR
Starts each additional part of a WHEN condition on its own line, led by AND or OR.on
ID061ProLinebreak After AND/OR
LBA_CASE_ANDOR
Puts the condition on the line after the operator.off
ID254ProIndent AND/OR in CASE Condition
IND_CASE_ANDOR
Indents the AND / OR operators inside a WHEN condition one level deeper.off
ID056 off
when salary > 5000 and job = 'MGR' and active = 1 then 'senior'
ID056 on
when salary > 5000
     and job = 'MGR'
     and active = 1 then 'senior'

Small CASE Statements

IDOptionWhat it doesDefault
ID067ProNo Linebreak for CASE Statement smaller than this number o...
LB_WIDTH_SMALL_CASE
CASE expressions of up to and including this many characters are kept on one line. Prevents a two-branch flag conversion from occupying six lines. Set to 0 to always break.10

Keeps a two-branch flag conversion from occupying six lines.

ID067 = 0
select case
           when flag = 1 then 'Y'
           else 'N'
       end as active
from   employee
ID067 = 40
select case when flag = 1 then 'Y' else 'N' end as active
from   employee

Option IDs are identical across all SQLinForm editions (VS Code, JetBrains, SSMS, Notepad++, Online Formatter) and are the keys stored inside a profile file. Generated from properties.json 2026.8.21.0.