Indentation mising on Pivot Tables FOR
Davidian
Posts: 13 Bronze 1
in SQL Prompt
This indentation on the FOR command is missing for pivot tables.
This isn't obvious if the pivot is your only command but even wrapping it in an BEGIN and END you can see how the rest of the command is indented but the FOR is not
When you have more complex procs this indentation is heavily noticeable but either way it is problematic.
Other than "remember to check pivots each time you KY" is there something that can be done?
This isn't obvious if the pivot is your only command but even wrapping it in an BEGIN and END you can see how the rest of the command is indented but the FOR is not
When you have more complex procs this indentation is heavily noticeable but either way it is problematic.
Other than "remember to check pivots each time you KY" is there something that can be done?
Tagged:
Answers
Thank you for reaching out on the Redgate forums regarding your indentation concern.
Are you able to share a sample SQL statement that highlights this unexpected behaviour.
I would like to replicate this in my test environment as close as your working example & escalate through to our developers to look further into this formatting behaviour.
Thank you for the example script & image.
My first thought is perhaps it may be the collapsing of parentheses occurring here. Can you please confirm if enabling/disabling this setting makes changes to your FOR statement within the parentheses
Formatting Styles > Global > Parentheses > Collapse parentheses if contents are shorter than <x> characters
turning it off sorts that FOR statement, but also this:
becomes:
So it seems like there is no way to balance having both
The closest from here seems to be if I change List items from always to if longer than wrap column
however other statements like:
become
Which is sort of the reverse of what I am going for with those ones lol.
I will have to keep playing.