Formatting of parentheses in WHERE and JOINs
Posted: Sun 26 Feb 2017 13:11
Is it possible to set formatting of parentheses on WHERE and JOINs?
Let's say I have a select statement and I want it to be formatted like this:
The "Format Document" command with re-format it to:
Is there a section in "Options/Text Editor/Formatting/Profiles" to set rules for parentheses in general or for JOINs and WHERE clauses?
TIA
Tom
Let's say I have a select statement and I want it to be formatted like this:
Code: Select all
USE [TSQLV3];
GO
SELECT
*
FROM [Sales].[Orders] AS [O]
INNER JOIN [Sales].[Customers] AS [C]
ON
(
[C].[custid] = [O].[custid]
)
WHERE
(
EXISTS
(
SELECT
*
FROM [Sales].[OrderDetails] AS [OD]
WHERE
(
[OD].[orderid] = [O].[orderid]
AND
[OD].[qty] > 40
)
)
);
Code: Select all
USE [TSQLV3];
GO
SELECT
*
FROM [Sales].[Orders] AS [O]
INNER JOIN [Sales].[Customers] AS [C]
ON
(
[C].[custid] = [O].[custid]
)
WHERE
(
EXISTS
(
SELECT
*
FROM [Sales].[OrderDetails] AS [OD]
WHERE
(
[OD].[orderid] = [O].[orderid]
AND
[OD].[qty] > 40
)
)
);
TIA
Tom