SQL Format on a merge statement with multiple case statements
UPDATE Set ...... /* the update statement is formatted correctly)
WHEN NOT MATCHED BY TARGET THEN
)
)
Best Answer
-
Jon_Kirkwood Posts: 441 Gold 1
Hi @dkekish
Thank you for reaching out on the Redgate forums regarding your SQL Prompt layout query.
I think it may be worth looking at the INSERT section of the Formatting styles (Formatting styles > Clauses > INSERT
There is a setting 'Place subsequent values on new lines'
Setting this to 'Always' does seem to change that nested behavior in your code snippets.
You can further modify the behavior of each case statement through Formatting styles > Expressions > CASE
This should tackle your two examples with non-case inserts appearing on the same line
and also your example with 3 case checks
Is this the type of behavioral change you are wanting to see with your style?
Jon Kirkwood | Technical Support Engineer | Redgate Software
Answers