Indents on Formatting code inconsistent

Refactors and formats SQL code.

Moderators: Chris Auckland, David Atkinson, Anu Deshpande, Luke Jefferson

Indents on Formatting code inconsistent

Postby MartinB » Thu Sep 10, 2009 8:17 am

Hi when you format code with a sub select the indentation is inconsistent.
I have my indentation set to 4 spaces which when I format most code is OK
But
When I have a sub select in the code it indents the sub select code with only 2 spaces (The formatting below has been done by this page but you get the idea - the indents under the first From are 2 but the indents under the FROM in the sub select is 1 )
If I set my indent to be 4 I expect it to be 4 throughout ALL the code

Code: Select all

SELECT
    *
FROM
    Member m
WHERE
    memberid IN ( SELECT TOP 100
                    memberid
                  FROM
                    member where membername like '%smith')
MartinB
 
Posts: 5
Joined: Fri Sep 04, 2009 10:42 am

Postby Anu Deshpande » Fri Sep 11, 2009 9:40 am

Many thanks for your post Martin.

Can you kindly let us know the expected formatting out put of the query?
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge

Re:

Postby MartinB » Wed Sep 16, 2009 3:38 pm

Anu Deshpande wrote:Many thanks for your post Martin.

Can you kindly let us know the expected formatting out put of the query?

Hi

I have my indentation set to 4 spaces So for a SELECTstatement I
expect the the begining letter of the column name to allign under the second e of SELECT i.e 4 chars in
Normally this happens OK
but if the select statement is offset to the right on the page as when you are doing a sub select it aligns the field colums under the L of the SELECT.
Hope this makes sense.
I cant display an example here because the rendering of this page appears to have its own formatting rules.
If you want I can email examples.
MartinB
 
Posts: 5
Joined: Fri Sep 04, 2009 10:42 am

Postby Anu Deshpande » Thu Sep 17, 2009 1:57 pm

As per our email communication.

I wrote: \"Thanks for your prompt reply.

Yes you are right it is inconsistent hence I have logged this as a bug in our internal tracking system SR-855.

So that it can be reviewed by our development team and considered as candidate in our future release.

Thanks for your prompt reply and your feedback it is highly appreciated.\"
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests