![SoftTree Technologies](templates/GreenTech/images/logo.gif) |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Daveii
Joined: 10 Dec 2008 Posts: 22 Country: United States |
|
SQL Formatting |
|
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 |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7843
|
|
|
|
Which database is that? SQL Assistant version?
|
|
Tue Jan 23, 2018 4:28 am |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7843
|
|
|
|
By the way, here is the result I get after formatting. I tested it with SQLite connection.
![](templates/GreenTech/images/code_header.gif) |
![](templates/GreenTech/images/spacer.gif) |
/************************************************************
* 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 |
|
![](templates/GreenTech/images/spacer.gif) |
Daveii
Joined: 10 Dec 2008 Posts: 22 Country: United States |
|
|
|
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 |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7843
|
|
|
|
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 |
|
![](templates/GreenTech/images/spacer.gif) |
Daveii
Joined: 10 Dec 2008 Posts: 22 Country: United States |
|
|
|
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 |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7843
|
|
|
|
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 |
|
![](templates/GreenTech/images/spacer.gif) |
Daveii
Joined: 10 Dec 2008 Posts: 22 Country: United States |
|
|
|
That worked. Thank you!
|
|
Thu Mar 29, 2018 6:14 pm |
|
![](templates/GreenTech/images/spacer.gif) |
|
|
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
|
|
|