What are the challenges you face when working across database platforms? Take the survey
Options

Format SQL: aligning comments

hobbsenigmahobbsenigma Posts: 4
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?

Comments

  • Options
    Anu DAnu D Posts: 876 Silver 3
    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
  • Options
    This is what I want (comments treated as code for indent purposes):
            
                    -- 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):
         -- comment  
    	  -- comment		
    
                    if (@adjustment_type <> 1) 
                        begin				
    
    	  	  --  comment
    
                            exec AP_Item_Burden_Bill                             
    
                        end				
    
  • Options
    Anu DAnu D Posts: 876 Silver 3
    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
  • Options
    Another vote for the comment alignment feature!

    -Dave
  • Options
    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.
  • Options
    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
Sign In or Register to comment.