SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
SQL Formatting

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
SQL Formatting
Author Message
Daveii



Joined: 10 Dec 2008
Posts: 22
Country: United States

Post SQL Formatting Reply with quote
Hi,

After the following line is entered and Cntr=>F11 is pressed...

select * from TableA a inner join TableB b on a.key = b.key

...it is currently formatted as...

select *

from TableA a inner join TableB b on a.key = b.key

How can it be changed to format it like the following?

select *

from TableA a

inner join TableB b
on a.key = b.key
Mon Jan 22, 2018 9:19 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
Which database is that? SQL Assistant version?
Tue Jan 23, 2018 4:28 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
By the way, here is the result I get after formatting. I tested it with SQLite connection.

Code:
/************************************************************
 * Code formatted by SoftTree SQL Assistant © v9.5.453
 ************************************************************/

SELECT *
FROM   TableA a
       INNER JOIN TableB b
            ON  a.key = b.key


Tue Jan 23, 2018 4:30 am View user's profile Send private message
Daveii



Joined: 10 Dec 2008
Posts: 22
Country: United States

Post Reply with quote
I am using SQL Assist version 9.5.452 with SQL Server Management Studio version 17.4

I get the same format as you after resetting the "Code Formatting" section.

How can it be made to look in my original example?
Tue Jan 23, 2018 12:19 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
Do you mean uppercase keywords or something else? I'm not seeing other significant differences.

If uppercasing, there is a separate option for keyword casing.
Tue Jan 23, 2018 12:29 pm View user's profile Send private message
Daveii



Joined: 10 Dec 2008
Posts: 22
Country: United States

Post Reply with quote
I'd like the "Inner" statement to be left aligned with the "From" clause. Same for "On".

select *

from TableA a

inner join TableB b
on a.key = b.key
Tue Jan 23, 2018 12:32 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
You can modify the "select" rule in the Options on the Code Formatting tab, T-SQL Custom Style. Remove the white space in front of JOIN keyword.

You can use the Test... button in the top-right corner of that tab page to test immediately the results. If satisfied with them, click the Apply button to save your changes.

Just in case, the default hot key for applying custom formatting style to the code is Ctrl+Shift+F11
Tue Jan 23, 2018 4:57 pm View user's profile Send private message
Daveii



Joined: 10 Dec 2008
Posts: 22
Country: United States

Post Reply with quote
That worked. Thank you!
Thu Mar 29, 2018 6:14 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.