Format SQL: aligning comments

Provides intelligent code completion for SQL Server editors.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Paul Stephenson, Michelle Taylor, Mike Upton, justin.caldicott, Aaron Law

Format SQL: aligning comments

Postby hobbsenigma » Sun Feb 06, 2011 5:01 am

When I use the Format SQL command, it works great on the code. But in general, I want to align comments along with the code. E.g., if a statement would be tabbed in, I want the comment above it to be tabbed in also. Is there a way to accomplish this?
hobbsenigma
 
Posts: 3
Joined: Sun Feb 06, 2011 4:48 am

Postby Anu Deshpande » Mon Feb 07, 2011 12:19 pm

Thanks for your post.

Can you please explain the requirement with example?
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

Postby hobbsenigma » Tue Feb 08, 2011 4:44 pm

This is what I want (comments treated as code for indent purposes):
Code: Select all
       
                -- comment
                -- comment      

                if (@adjustment_type <> 1)
                    begin            

                        --  comment

                        exec AP_Item_Burden_Bill                             

                    end            


but this is what I get (comments untouched, left wherever they happened to be):

Code: Select all
     -- comment 
     -- comment      

                if (@adjustment_type <> 1)
                    begin            

          --  comment

                        exec AP_Item_Burden_Bill                             

                    end            
hobbsenigma
 
Posts: 3
Joined: Sun Feb 06, 2011 4:48 am

Postby Anu Deshpande » Thu Feb 10, 2011 2:02 pm

Many thanks for your post.

We appreciate your feedback and hence logged this as a feature request in our internal tracking system whose tracking id is SP-3797.

It will be reviewed by product manager and than marked for the future release.

I will update you as soon as it is incorporated.
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

Postby DaveB » Thu Mar 31, 2011 1:30 pm

Another vote for the comment alignment feature!

-Dave
DaveB
 
Posts: 8
Joined: Sun Mar 27, 2011 3:11 am

Postby akrohn » Mon Apr 04, 2011 8:03 pm

This is crucial, otherwise the reformat feature is always followed by going through your code by hand and align all comments. Strange this got not implemented yet.
akrohn
 
Posts: 5
Joined: Mon Jul 28, 2008 11:56 am

+1

Postby willspurgeon » Mon Jul 01, 2013 5:04 pm

+1
willspurgeon
 
Posts: 5
Joined: Fri Jan 16, 2009 8:44 pm

Nice

Postby jasmine78888 » Wed Jul 03, 2013 1:33 pm

Nice surprise about this shorter form. Can you tell us what it is you are talking/writing about?Has any info. about this shorter form been posted before (and i just missed it)?
Jasmine
jasmine78888
 
Posts: 1
Joined: Wed Jul 03, 2013 1:31 pm


Return to SQL Prompt 5

Who is online

Users browsing this forum: No registered users and 0 guests