How do I configure after "WHERE (" and aligning "ON"? in a sub select?

8 Posts
2 Users
0 Reactions
931 Views
Posts: 5
Topic starter
(@itsnota2ma)
Member
Joined: 4 months ago
[#156]

You can see from my sample below, I do not want a new line after "WHERE(" and I do not want "ON" to align. I also noticed the SELECT fields do not align in the sub select. Is this configurable??

LEFT OUTER JOIN ( SELECT ModuleID,
              UserDefined3,
              OwnerID
         FROM AdditionalInfo AS AdditionalInfo_2
        WHERE(
                 ModuleID = 12) ) AS Finish ON Items.ItemID = Finish.OwnerID
LEFT OUTER JOIN InventoryTracking           ON Items.InventoryTrackingID = InventoryTracking.InventoryTrackingID
LEFT OUTER JOIN Categories                  ON Items.CategoryID = Categories.CategoryID

It should look like this:

LEFT OUTER JOIN (SELECT ModuleID,
                        UserDefined3,
                        OwnerID
                 FROM AdditionalInfo AS AdditionalInfo_2
                 WHERE(ModuleID = 12) 
                 ) AS Finish ON Items.ItemID = Finish.OwnerID
LEFT OUTER JOIN InventoryTracking ON Items.InventoryTrackingID = InventoryTracking.InventoryTrackingID
LEFT OUTER JOIN Categories ON Items.CategoryID = Categories.CategoryID

7 Replies
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

Hi @itsnota2ma,

Question 1:you can avoid a new line after "WHERE(" be unchecking the linebreaks for condition brackets 

grafik

Question 2: You cannot avoid the alignment of the on if the "on" has no linebreak before

Question 3: here you have 2 options
Option 1: put a linebreak after the sub-select open bracket and the SELECT will be moved to its correct position

grafik

Option2 (recommended): In the new Release there is a new option for Sub-selects called "Align Sub-Select to Open Bracket"

grafik

Hope this helps


Reply
Posts: 5
Topic starter
(@itsnota2ma)
Member
Joined: 4 months ago

Well, this explains a few things. I do not have those options and when I open from SSMS, this is what I get. And I just installed the latest version for SSMS 22. I was pointing to the old desktop version. I see the plugin in SSMS, which does not have those options, and I cannot find the executable for the desktop version once I removed the SSMS 21 version.

image

Reply
Posts: 5
Topic starter
(@itsnota2ma)
Member
Joined: 4 months ago

Okay, I just downloaded the Portable App and I see the changes I can make.


Reply
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

Hi @itsnota2ma,

in the ssms plugin there is a tab for subselect options and a tab for Condition Options

grafik

Reply
Page 1 / 2
Share: