How to keep a subquery for an IF on a single when formatting?

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
Thenrich
Posts: 105
Joined: Sun 21 Dec 2014 19:47

How to keep a subquery for an IF on a single when formatting?

Post by Thenrich » Sun 19 May 2019 05:47

I have this statement:

Code: Select all

IF (NOT EXISTS (SELECT  1 FROM customer WHERE CustomerId = 1  ) )
  BEGIN
  END
and every time I format the code, I get this:

Code: Select all

  IF (NOT EXISTS (SELECT
      1
    FROM customer
    WHERE CustomerId = 1)
  )
  BEGIN
  END
I don't see an option under IF formatting to keep subqueries in single line. I have changed several options and nothing works.

alexa

Re: How to keep a subquery for an IF on a single when formatting?

Post by alexa » Tue 21 May 2019 05:07

Please perform the following:
1. Select 'SQL Complete -> Options...' from the main menu. The 'Options' window opens.
2. Navigate to the 'Formatting -> Profiles' branch.
3. Select the active profile and click the 'Edit Profile...' button.
4. Navigate to the 'Subquery -> Single line -> ALL, ANY, SOME, EXISTS operators' node.
5. Select the 'Any subquery' option.

Post Reply