 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
brian_rassiner
Joined: 08 Jan 2008 Posts: 9
|
|
Align SQL Code |
|
Is there any way to align the SQL code:

|
|
Wed Aug 26, 2009 7:26 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
brian_rassiner
Joined: 08 Jan 2008 Posts: 9
|
|
Align SQL Code |
|
Any way to have this added as an enhancement in a future release.
|
|
Thu Aug 27, 2009 8:26 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
brian_rassiner
Joined: 08 Jan 2008 Posts: 9
|
|
Align SQL Code |
|
Thanks... however it probably needs to be a little more general... see attached

|
|
Fri Aug 28, 2009 3:52 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
|
|
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
|
|
|