SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Formatting Question in v4

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Formatting Question in v4
Author Message
seth.rothman



Joined: 29 Jan 2008
Posts: 54
Country: United States

Post Formatting Question in v4 Reply with quote
Quick question. I'd like my FROM and JOIN keywords to be left-aligned together. For example:

select field1,field2,field3
from table1 t1
inner join table2 t2
on t1.field1 = t2.field2
where t1.field > 0

formats to:


SELECT field1,
field2,
field3
FROM table1 t1
INNER JOIN table2 t2
ON t1.field1 = t2.field2
WHERE t1.field > 0

which is almost what I want. I'd like the final result to look like this:


SELECT field1,
field2,
field3
FROM table1 t1
INNER JOIN table2 t2
ON t1.field1 = t2.field2
WHERE t1.field > 0

Is this possible?
Thu Nov 06, 2008 12:38 pm View user's profile Send private message
seth.rothman



Joined: 29 Jan 2008
Posts: 54
Country: United States

Post Reply with quote
I just reviewed my posting and the spaces were stripped out. Oops. Here's a screenshot

Thu Nov 06, 2008 12:42 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
I don't see any difference. Have you pasted the text or typed it directly?
Thu Nov 06, 2008 12:43 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
Ok. I see the screenshot now. Thanks.

Sure this can be done. Here is how

Open SQL Assistant Options -> activate Code Formatting tab -> select formatting style you want to customize, for example, "T-SQL Custom Style 1" -> in the specific statements list on the left choose SELECT, on the right adjust the formatting pattern for this statement as required, you can set spacing for each required element, for example, remove spaces before JOIN -> Click "Test..." button in the top-right corner of the Options dialog to check results, enter some test SQL and see if it does what you want, if yes, close the test box and Apply changes.
Thu Nov 06, 2008 12:48 pm View user's profile Send private message
seth.rothman



Joined: 29 Jan 2008
Posts: 54
Country: United States

Post Reply with quote
That works perfectly. Thanks for you help.
Thu Nov 06, 2008 12:59 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
You're welcome.
Thu Nov 06, 2008 1:01 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.