SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Align SQL Code

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Align SQL Code
Author Message
brian_rassiner



Joined: 08 Jan 2008
Posts: 9

Post Align SQL Code Reply with quote
Is there any way to align the SQL code:

Wed Aug 26, 2009 7:26 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Either the attached file is too big or there is an outage on the image hosting site. I keep getting persistent timeout errors 504 Gateway Time-out. I'll reply to your message after I get a chance to see the image.
Wed Aug 26, 2009 9:40 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Sorry, I don't think this can be currently done. You cannot specify a formatting pattern with a variable number of spaces.
Thu Aug 27, 2009 7:59 am View user's profile Send private message
brian_rassiner



Joined: 08 Jan 2008
Posts: 9

Post Align SQL Code Reply with quote
Any way to have this added as an enhancement in a future release.
Thu Aug 27, 2009 8:26 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Yes, I can submit it as an enhancement request. I am going to formulate this requirement as "space alignment for assignment operators"
Thu Aug 27, 2009 10:37 pm View user's profile Send private message
brian_rassiner



Joined: 08 Jan 2008
Posts: 9

Post Align SQL Code Reply with quote
Thanks... however it probably needs to be a little more general... see attached

Fri Aug 28, 2009 3:52 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Thank you for the suggestions. From my point of view each of the suggested cases is not really generic and has somewhat narrow scope. Anyway, for the second case I think you can handle it by setting up new custom formatting rules. Because the alignment is always the same for datatype, their word length is known.

For example, to setup fixed alignment for INT NOT NULL, add new formatting rule called "in not null" for the rule text enter INT[tab here][tab here]NOT NULL. Create similar rule for "int null" and repeat this for other simple datatypes like datetime, guid, etc… For datatypes with variable length, add rules like ") not null" and ") null")


By the way, if you don't want to see "Formatted by ...." header every time you format the code, you can disable that rule in the settings, just uncheck the "header" rule. In case you don't want things like NAME, DESCRIPTION, DELETED, etc... uppercased during formatting, you can remove them from keyword list. On one hand, if they are used in statements where they represent keywords, they won't be uppercased too. On the other hand, such statements are used rarely, while referenced words are commonly used as column names.
Fri Aug 28, 2009 8:30 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.