Formatting of parentheses in WHERE and JOINs

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
tomashiba
Posts: 2
Joined: Wed 19 Aug 2015 13:05

Formatting of parentheses in WHERE and JOINs

Post by tomashiba » 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:

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
    
		)
	)
);
The "Format Document" command with re-format it to:

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

			)
	)
	);
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

alexa

Re: Formatting of parentheses in WHERE and JOINs

Post by alexa » Mon 27 Feb 2017 16:27

We will investigate this issue and will answer you as soon as possible.

alexa

Re: Formatting of parentheses in WHERE and JOINs

Post by alexa » Fri 03 Mar 2017 15:42

Sorry for the delay on this.

There is no such a possibility in dbForge. Though, we have added a suggestion on our UserVoice forum where other users can vote for it https://devart.uservoice.com/forums/878 ... osed-in-br

You can also vote for this feature.

We collect and analyze the information from this forum in order to make a proper roadmap for future product releases.

Post Reply