How can we help you today? How can we help you today?
way0utwest
OK, I have these answers: ========= This is due to the Control Flow options they have set and the example they use in the different cases.  So they have "Place BEGIN keyword on new line" true "Indent BEGIN END keywords" false "Indent contents of statements" true "Collapse statements shorter than <100> characters" true In the first example ```IF @Country = 'USA' BEGIN SET @FormatCode = 1; END; ELSE BEGIN SET @FormatCode = 2; END;``` It's collapsing the statements because they are shorter than 100 characters - this overrides the Begin on new line and the indent contents of statements. It does something odd though if you make "Place BEGIN keyword on new line" false but leave the others - it then indents the second SET statement which I think is probably a bug. In their last example the content of the BEGIN/END is more than 100 chars and so it doesn't collapse it. This is all independent of how far the IF is indented as that will be set to the correct indention if the collapse is not set.  So if you add another BEGIN / END around the above query and turn off collapse, it will indent the content of the overall BEGIN as well as the internal BEGINs to the correct place ======== I've played with the style. I think the removing the collapse item fixes most of this, but the SETs are still wrong if things are not included inside some other structure. Is this just a script you have or is it part of a larger set of work? / comments
OK, I have these answers:=========This is due to the Control Flow options they have set and the example they use in the different cases.  So they have"Place BEGIN keyword on new line" true"Indent B...
0 votes
Hmm, with your style, I get this: IF @Country = 'USA' BEGIN<br>SET @FormatCode = 1;<br>END;<br>ELSE BEGIN<br>SET @FormatCode = 2;<br>END;Not sure why you get the weird formatting. I'll have to bump this. / comments
Hmm, with your style, I get this: IF @Country = 'USA' BEGIN<br>SET @FormatCode = 1;<br>END;<br>ELSE BEGIN<br>SET @FormatCode = 2;<br>END;Not sure why you get the weird formatting. I'll have to bump...
0 votes
I'm unclear of what's happening here. I don't get the before/after view here. Is this post formatting? I don't see this behavior, but I wonder if I'm not reproducing this correctly. / comments
I'm unclear of what's happening here. I don't get the before/after view here. Is this post formatting? I don't see this behavior, but I wonder if I'm not reproducing this correctly.
0 votes
Does this happen often? Is Counter in multiple tables in this query? Do you know what might be on the right side? / comments
Does this happen often? Is Counter in multiple tables in this query? Do you know what might be on the right side?
0 votes