Conditionally place ON keyword on new line if exceeds specified wrap margin
My default preference is to maintain the ON keyword without a new line. I would like to be able to CONDITIONALLY place the ON keyword on a new line if, and only if the ON keyword together with the associated ON condition exceed a configurable wrap threshold.
Example:
-- Yield this >>>>
SELECT *
FROM Person.Address
INNER JOIN Person.StateProvince
ON StateProvince.StateProvinceID=Address.StateProvinceID
-- >>>> instead of
SELECT *
FROM Person.Address
INNER JOIN Person.StateProvince ON StateProvince.StateProvinceID=Address.StateProvinceID
-- Assuming the JOIN clause exceeds the wrap length
-- <<<
This is particularly useful if the "Place JOIN table on new line" is NOT selected (which is my preference).